From patchwork Mon Mar 14 16:57:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12780505 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72DF9C433EF for ; Mon, 14 Mar 2022 16:57:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 832306B0071; Mon, 14 Mar 2022 12:57:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 792948D0003; Mon, 14 Mar 2022 12:57:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A84E6B0073; Mon, 14 Mar 2022 12:57:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 32FB46B0072 for ; Mon, 14 Mar 2022 12:57:35 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id ED0702401E for ; Mon, 14 Mar 2022 16:57:34 +0000 (UTC) X-FDA: 79243598028.06.DB6201D Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf28.hostedemail.com (Postfix) with ESMTP id 25869C0011 for ; Mon, 14 Mar 2022 16:57:33 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B45C41F380; Mon, 14 Mar 2022 16:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1647277052; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EjQj53Mw0YNh700fK1Icsq6ho1Eko/PdYkCQNR6mqrE=; b=gugqY4B+djL/nhmH2nhDAdJV9P41rQYJ2g8SWA9aCiKiiKSdP2+uGZsC4sPdnLQ8fOgSCH qSm6oJPE6pYN89aep1Xr1FKgtz60j1MreAp0B6P5lM0t/5RqEp9n8OdcaLZGDVga6OGmeo UaWZx+zlPEUkeANI0uWQ9uIAZDXJ17E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1647277052; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EjQj53Mw0YNh700fK1Icsq6ho1Eko/PdYkCQNR6mqrE=; b=fnCZrvmEeOA7aH1I0CkzTH1mPfrTtZJOzoyH8BmBVce8WgahkZwgQgUp/95n0M8XfYcZLU 0/4ZOUhnIT9ymwAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8994213B39; Mon, 14 Mar 2022 16:57:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id RbYpIPxzL2I+PAAAMHmgww (envelope-from ); Mon, 14 Mar 2022 16:57:32 +0000 From: Vlastimil Babka To: Andrew Morton , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Mel Gorman , Matthew Wilcox , David Hildenbrand , Vlastimil Babka Subject: [PATCH 1/2] mm, fault-injection: declare should_fail_alloc_page() Date: Mon, 14 Mar 2022 17:57:23 +0100 Message-Id: <20220314165724.16071-1-vbabka@suse.cz> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1119; h=from:subject; bh=QGoL6qUI09dpG/35dBQDgHemHz/FCAGmqGRnNq+rios=; b=owEBbQGS/pANAwAIAeAhynPxiakQAcsmYgBiL3Pyn7opOzfCBHWa660u1sfUHhTXqveiKMNIEZ6Q pT5b1QiJATMEAAEIAB0WIQSNS5MBqTXjGL5IXszgIcpz8YmpEAUCYi9z8gAKCRDgIcpz8YmpEMjmCA C9dqVWnbqOG9kRwx4yBIUGJqbzVqSalN5zHjMGiyDG9PUa8Mnsw9v6WJnWG1gaXlTYM2UMkddxUri0 kEpkTc6qNrYCiVzwkr8MVCFU9JEDYmIkPz/EBljtAn0cjEZnHhcM5BVQeJ5J48dZzz25H4PgSc1bW5 FKbXmRop8pWwllwouudA5m0JJrLP+IeNyEC/GPxsTJGWqpiCFEmBpdJSJWDxoCf5jEax4yqzbwKUnj jAcBl7tnK4lVHEyhafgDiTGXts1HxQWuXkWqLza096bE/p3c0aJKNWEU43yOANIOKTZN/vJ9X4Kycb ZThdDMOsM+5NMxrU4PpYv+0bfjRDxj X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 25869C0011 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=gugqY4B+; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=fnCZrvmE; spf=pass (imf28.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspam-User: X-Stat-Signature: 5qc6kxaa5ggjy1qkszf8egxxst8nsggm X-HE-Tag: 1647277053-861638 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The mm/ directory can almost fully be built with W=1, which would help in local development. One remaining issue is missing prototype for should_fail_alloc_page(). Thus add it next to the should_failslab() prototype. Note the previous attempt by commit f7173090033c ("mm/page_alloc: make should_fail_alloc_page() static") had to be reverted by commit 54aa386661fe as it caused an unresolved symbol error with CONFIG_DEBUG_INFO_BTF=y Signed-off-by: Vlastimil Babka --- include/linux/fault-inject.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h index e525f6957c49..2d04f6448cde 100644 --- a/include/linux/fault-inject.h +++ b/include/linux/fault-inject.h @@ -64,6 +64,8 @@ static inline struct dentry *fault_create_debugfs_attr(const char *name, struct kmem_cache; +bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order); + int should_failslab(struct kmem_cache *s, gfp_t gfpflags); #ifdef CONFIG_FAILSLAB extern bool __should_failslab(struct kmem_cache *s, gfp_t gfpflags); From patchwork Mon Mar 14 16:57:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12780504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F09AC433F5 for ; Mon, 14 Mar 2022 16:57:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E19D8D0001; Mon, 14 Mar 2022 12:57:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5910E8D0002; Mon, 14 Mar 2022 12:57:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4314C8D0001; Mon, 14 Mar 2022 12:57:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 315866B0071 for ; Mon, 14 Mar 2022 12:57:35 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id DBECD247D4 for ; Mon, 14 Mar 2022 16:57:34 +0000 (UTC) X-FDA: 79243598028.14.7B0909D Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf09.hostedemail.com (Postfix) with ESMTP id 2BF91140016 for ; Mon, 14 Mar 2022 16:57:33 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id CEF15210F9; Mon, 14 Mar 2022 16:57:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1647277052; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OxXwFHPNzH5Csyhh4StleU/1uE5aiwhYDOtjRtBM8Cs=; b=0ErJaYnJIqPZaBs+I1ty5OXDQBllInMcDso1OSQDpnCeJkCEXe7GqvvyWmjf+G0Ck8EpZq THeQvMj89rYiWZJr2WTsfi9C8G6XAyWK+h8AKNfmzR0kvtSAanOzUmj5c2N3scVIuzeHEX QJNQv4P7ni52vdAIkhatE2h2GKNORFs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1647277052; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OxXwFHPNzH5Csyhh4StleU/1uE5aiwhYDOtjRtBM8Cs=; b=AODhh5jhdKhN6dl7oIOx9NiQoT4GhrtmrFrIQBE0M+KjDBi84wWkT8rAT2dKpvytrDlFxN I4pKIJVhsE4A+9Aw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AE9E013B9A; Mon, 14 Mar 2022 16:57:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sGz1KfxzL2I+PAAAMHmgww (envelope-from ); Mon, 14 Mar 2022 16:57:32 +0000 From: Vlastimil Babka To: Andrew Morton , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, Mel Gorman , Matthew Wilcox , David Hildenbrand , Vlastimil Babka Subject: [PATCH 2/2] mm/early_ioremap: declare early_memremap_pgprot_adjust() Date: Mon, 14 Mar 2022 17:57:24 +0100 Message-Id: <20220314165724.16071-2-vbabka@suse.cz> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314165724.16071-1-vbabka@suse.cz> References: <20220314165724.16071-1-vbabka@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1262; h=from:subject; bh=7vyyC8zALJ4SuHOC5Gb+d+1XDIpeD1sRQmLdSzD1PtI=; b=owEBbQGS/pANAwAIAeAhynPxiakQAcsmYgBiL3PzVFbcI0UT/MAE1ZzpBx7qovtYTchrj7J6OO9A KzJzkROJATMEAAEIAB0WIQSNS5MBqTXjGL5IXszgIcpz8YmpEAUCYi9z8wAKCRDgIcpz8YmpENlUCA CnUgCA9PKggdYKeRUblvVPEAL3cg75UMqK2D+sXbmrCKeEMZirLx+xgKARoMUzXfBZitHGZi4D8hJX BRGNHk5hZQLVf38pO+jRObxiNsfBmmjGlfyuDpaGlgaqlGVSHhEafjY5gP5gJi9qeasT+/fr049qec CRbPIB3BQCX4jEgd2XC94yWG/KEj5fGgHpM7/Fgw/dVqvlVWcPE+jXhGvFOcY2UwUD1Dm06+3FBvA1 KX74PDGs8wueuKxRMLySgslgOriAT+mYgB6nfsjqok4BB0mzVqVaRsAyQTePmDTiD49PnKHfFTfOYG Kn60Kbud5m9Nj6JHTnt4qzdgThG3oe X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 X-Stat-Signature: 5q6n1abid97fq1xm4mp3etyuxaepapiq Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=0ErJaYnJ; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=AODhh5jh; spf=pass (imf09.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2BF91140016 X-HE-Tag: 1647277053-299777 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The mm/ directory can almost fully be built with W=1, which would help in local development. One remaining issue is missing prototype for early_memremap_pgprot_adjust(). Thus add a declaration for this function. Use mm/internal.h instead of asm/early_ioremap.h to avoid missing type definitions and unnecessary exposure. Signed-off-by: Vlastimil Babka --- mm/early_ioremap.c | 1 + mm/internal.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c index 74984c23a87e..9bc12e526ed0 100644 --- a/mm/early_ioremap.c +++ b/mm/early_ioremap.c @@ -17,6 +17,7 @@ #include #include #include +#include "internal.h" #ifdef CONFIG_MMU static int early_ioremap_debug __initdata; diff --git a/mm/internal.h b/mm/internal.h index d80300392a19..e3e2a3c5f655 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -154,6 +154,12 @@ extern unsigned long highest_memmap_pfn; */ #define MAX_RECLAIM_RETRIES 16 +/* + * in mm/early_ioremap.c + */ +pgprot_t __init early_memremap_pgprot_adjust(resource_size_t phys_addr, + unsigned long size, pgprot_t prot); + /* * in mm/vmscan.c: */