From patchwork Tue Mar 21 14:48:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13182862 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 55807C6FD1D for ; Tue, 21 Mar 2023 14:49:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D20EA6B0074; Tue, 21 Mar 2023 10:48:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA92C6B0078; Tue, 21 Mar 2023 10:48:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B4A476B007B; Tue, 21 Mar 2023 10:48:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9FEEB6B0074 for ; Tue, 21 Mar 2023 10:48:59 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6E12A1412E7 for ; Tue, 21 Mar 2023 14:48:59 +0000 (UTC) X-FDA: 80593187598.02.E29023F Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf24.hostedemail.com (Postfix) with ESMTP id D373A18001B for ; Tue, 21 Mar 2023 14:48:57 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FveJqLJs; spf=pass (imf24.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679410137; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=2m7OanB9bBVjgeioKgMovgSo9NhiCGfkKJY0jXWcTPs=; b=bk+FYQQkocSMsQmgg59M4ZFhCeCj9K70SAnSVbVjuI6EWgEvwiOupiXzuDp+KxvS6dB7Sf kZzrXw/RTdBxAJDK//dCtXuLcgPUsDIAYKGJ0XNQxxQNrUwSWlKk8OXVsy188dPnjfrHse rLdl4LGKp0HSISagHwZ+ViX9ufiQJwg= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=FveJqLJs; spf=pass (imf24.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679410137; a=rsa-sha256; cv=none; b=zAF8WTe1Z2VrImPUR4vhPKBNGEFZiaqePQEhmKYBoGd6WoMt6Yg7q6Gkeqcyze+Zw0A7/Q r+S731FUq+EURD0gimlgdcY6S/QECovBGgi1Cz1fvorPiZK10uO0F+DQvPdNQHs5kW0x63 YZ68Fxi8VrLNIXOLVrNfhDBza+Xl+MY= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D22A861A25; Tue, 21 Mar 2023 14:48:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33AC7C433D2; Tue, 21 Mar 2023 14:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679410136; bh=nOjYuAtAJ+oJ6PX1M32a+RGsf1VV5zJ6P60y95eKQno=; h=From:To:Cc:Subject:Date:From; b=FveJqLJsTdxUlszzf27XECWvgGDeLI5jOdIJ0+/wTO6aegPJt5W28xY0tRgVhkjTA 3VbZySNbS7txvPmXnf9gPtH8ZMw+oF7xysW7+C1WiXl5f+7BCUv9ZNL1dTjD0MBpfu uaHWL0333MUd3rKfIwuUHwED3B8qbUHWT/kITg0Gs7J/SdmuNF5q7SJc/MJVoSaIOM oJ3xr3ucSsoZ7h1hfp9nRbXsA50rQETKS4aByEelOqjV6pD551jz+4SXJdkZtINE45 Xsm4AZ0l2F5VBbLBQcmbicE52ckHwOpwJq36oDJo/6Ylk40xhIiR6atv9JBxRctlKo yh6bN2fJZEheA== From: Mike Rapoport To: Andrew Morton Cc: David Hildenbrand , Doug Berger , Matthew Wilcox , Mel Gorman , Michal Hocko , Mike Rapoport , Thomas Bogendoerfer , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 01/14] mips: fix comment about pgtable_init() Date: Tue, 21 Mar 2023 16:48:41 +0200 Message-Id: <20230321144842.2401182-1-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D373A18001B X-Stat-Signature: wc59tfaj54961i4eo5xys3d7gp6ueh4s X-HE-Tag: 1679410137-218464 X-HE-Meta: U2FsdGVkX1/cdldPBvOhkczIH8G/iwrtNDdWZy/hdrXiMZJb0bwv97GuDbymyhAbD/5n1EKGDk93CzgXU4QY4QsaerIypesObYSEaFCNXHjjN7q62XgzYLF4bGm+VcyuX5lLa19VDT85EsNJAxju2KEKICG8Z3CVaW9EpXbh6MMPKADd7PuVGfE5X23PRUPu0PVyQ7S9SlQAsgfdA1b22l/6HmWeuKCdIjnaYqMc6bO+51pNKmv4zAv2LBExdi34o/WlIxpyG3PJ3h97oaQgwOgKc+f6q0+XP/WSc5yWR+JmQ69tZf2YXTQHkMZ+JVi3+PAip+6mxI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bjKj5Kk275qrlDg= 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: From: "Mike Rapoport (IBM)" Comment about fixrange_init() says that its called from pgtable_init() while the actual caller is pagetabe_init(). Update comment to match the code. Signed-off-by: Mike Rapoport (IBM) Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé --- arch/mips/include/asm/fixmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/fixmap.h b/arch/mips/include/asm/fixmap.h index beea14761cef..b037718d7e8b 100644 --- a/arch/mips/include/asm/fixmap.h +++ b/arch/mips/include/asm/fixmap.h @@ -70,7 +70,7 @@ enum fixed_addresses { #include /* - * Called from pgtable_init() + * Called from pagetable_init() */ extern void fixrange_init(unsigned long start, unsigned long end, pgd_t *pgd_base); From patchwork Tue Mar 21 14:48:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 13182863 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 D20C0C74A5B for ; Tue, 21 Mar 2023 14:49:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6696C6B0078; Tue, 21 Mar 2023 10:49:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6231D6B007B; Tue, 21 Mar 2023 10:49:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 46C746B007D; Tue, 21 Mar 2023 10:49:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 303CD6B0078 for ; Tue, 21 Mar 2023 10:49:03 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 05D33AC3C7 for ; Tue, 21 Mar 2023 14:49:03 +0000 (UTC) X-FDA: 80593187766.28.FF8E686 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf21.hostedemail.com (Postfix) with ESMTP id 54F091C0025 for ; Tue, 21 Mar 2023 14:49:01 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MZgDx47L; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf21.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679410141; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZaNZb4LBOh1DPy2+ie42i9qTor/7U8b9/7azGZRiNxY=; b=WXQ4GABJhzN21d4tjnLOpwQP2YN56PLqzTmW5ZETPqx5Gc2s5NlYNGoGEjcXFkOCyHEv0r y/fxW17g2PuYRGEcijtGR5DhVF2xJZit+mDfTWxgVxKGANWc6eiEz5RNWggMwn3KV23wR7 tPmgqPXZpkkLfZ7pehKDnefLc/tUDp8= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MZgDx47L; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf21.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679410141; a=rsa-sha256; cv=none; b=SB9i2wh9M2FSA8S0Q54Zf+uOFBZpJ0BFUhnyfePuhri5fxMsIVRPw1D39302NhE4frb7k9 pQQytVPW7PARmLq/tVUtxVJptwToaD8CYt85B0vy2nNUskNV3NBQpyMLq0NurlYggSsqVc PffoI4afW1uPp/dc1ssPnOCFZyyAY1c= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7100861A22; Tue, 21 Mar 2023 14:49:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C87FFC433EF; Tue, 21 Mar 2023 14:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679410139; bh=I9y2VS2sujmV0QDCgNwqn2cmquxP68oIIJXpFeZ8zWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MZgDx47LSq2yqkO1jLsajANmgKICCKk9x4MJFUx9toTpI5owdL1eGrNvQgeVzbgJX DEmFUvN5LWoPvbaAAnlBlAlSY2RCq4ca/07rb/402pUA5fJNz7GySo/gDhi/M7dScg OgDq60S3orSH2+/tKgz3D2nz0kz5c/SNWGgGgq4bQIJGVIb8SL2r5RYUq3Bub6EMCf 8wfA8dxMbY2Gs3hBjIFOv5ROJ/+HOB9rwccvJDJfIve6MSAke2z+8vOMvz/yP/jMiG kIlAH/vnKOmn2cKLwJAKnEGT8QUznBwKtmay97mFbCU5w3b6ShXv2zNK6P+sG53wo7 QVbYmbCdj7WCQ== From: Mike Rapoport To: Andrew Morton Cc: David Hildenbrand , Doug Berger , Matthew Wilcox , Mel Gorman , Michal Hocko , Mike Rapoport , Thomas Bogendoerfer , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 02/14] mm/page_alloc: add helper for checking if check_pages_enabled Date: Tue, 21 Mar 2023 16:48:42 +0200 Message-Id: <20230321144842.2401182-2-rppt@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230321144842.2401182-1-rppt@kernel.org> References: <20230321144842.2401182-1-rppt@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 54F091C0025 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: rjycehz6anjq3c9zhrd8opz6ayqi5cix X-HE-Tag: 1679410141-263393 X-HE-Meta: U2FsdGVkX1/Y/eLTxpFRJlMp8WTlePJOBJJ0ioe3BR7FY5moOZkD/VTpvLZpQDTYGxUbdoK8TJiPAOapHU8tVZY4Crq38iUhO2wRcoD5JxCGA2t13zg6NHT3hcqcqH3uazW2v/z613j3DgLCutAPlFCI4Ibs/sHF10csXNiAUt2IWCaGjouNPC0i4xp4L6wjxoayNpSn01QVrNWcBtSx2R2F3qLcRRYBWgQHpS0Nw8BjKCF0EunbZ8kWiW5FmwsDohQXrNAx+KkMobW7shQJadC9EtLUBjJQbMz8prUdZ0XR52qwUd7oVXv9wQCaomRlAO6pi0k3j3mTxbCECtRc3LyVW9BO1W9mXiCASzpEaJsLCFetQugor7mu7LaZC0EU2ma1I67ZIwl/G60VPjYglY/URHKdHwFawrsidJABRY3KTyc7V7nC6mBqQTNlLHgcbvnk6JJVjIwIIQQ41IXPsyq2KpfYvYgU0eTixWQ2/K/y6XbBS3AKsqJxmjMvrIPXJD2p7l+5u3w00qiIBdqbaO40jDH2TG30NhsYMxGDnIfDYiTvjw1qr/g3WjjC0FUIBUVSlQK1wILBK8LFVaZySA6PoNfG3Rs8NwO+x5OELh8Wz+rqQHekEeRtPsrEcxi+TS2igxguN6r9YIpdDso3YTI5p8qkXAsVQWgW1PsGPyPm3LHfp1OJfsPsTwUvsCsoAiCshYkO4MM8+ecB3hMkWMsRpnyX04Jvc0hZP0pXjJDhwFTGS3piauUCrspBPXTsYO0wL3CGqnAYmL4eyonln0K8aT0+JgCzOO3ZQFNjl6QIJuIGpPRrK3LCYWSl5I/L1NvKb7kjIQhadVTDmcDqNUNONYNzPwSzyrUFNLrbLC4HcUc7D5l1wphUWAyzi4NouDjyiVElGmPYjDkAISJpTy5YNJNjX1GNcl/F4AARn+Jgo8+/PiRIreH6tDf1Lid4Fa4aL7NElUNGE7w5w2s HzKhkP8c pqicWh1L9IPScG2x6OPJY0YG4DDCPr1XUPvwzP5hjFTSlioWq7tPVUT1sbEveNeCyvqRSC/IKcGKYWn5ylrvKYnNODvMitK2MyAlFUizZEjmSPFt21BpUzNXVvax4jUm3GmxxT6o5WuzYlhjNxrB7jmpd1M7cOfqH8TZaqt0/MSOTb1+ZO0WP/YDbR0sGmUcPEDLP/y2XakP1rB+Trl8SGvnlMflzSSUD9Oy+XT/PTcEuSgogtGwputsfP88cIbxQpNh65Ir1NnpclBJnvvuu1kyKM7G8ddHL5xfA+tvoEEbmn1Gkjm+mRsy83zlRG+bwl+YtREBmqNv9jCVAe60a8IZ4wU4OYOEKBHHH9a1Mk81Oy248IlKiyv9ZonjMhltimiiX50eB4B7mhdUd7+ciWtWeHLfKf6fDCW+zNMAqoo7HyZk= 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: From: "Mike Rapoport (IBM)" Instead of duplicating long static_branch_enabled(&check_pages_enabled) wrap it in a helper function is_check_pages_enabled() Signed-off-by: Mike Rapoport (IBM) Reviewed-by: David Hildenbrand --- mm/page_alloc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 87d760236dba..e1149d54d738 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -245,6 +245,11 @@ EXPORT_SYMBOL(init_on_free); /* perform sanity checks on struct pages being allocated or freed */ static DEFINE_STATIC_KEY_MAYBE(CONFIG_DEBUG_VM, check_pages_enabled); +static inline bool is_check_pages_enabled(void) +{ + return static_branch_unlikely(&check_pages_enabled); +} + static bool _init_on_alloc_enabled_early __read_mostly = IS_ENABLED(CONFIG_INIT_ON_ALLOC_DEFAULT_ON); static int __init early_init_on_alloc(char *buf) @@ -1443,7 +1448,7 @@ static __always_inline bool free_pages_prepare(struct page *page, for (i = 1; i < (1 << order); i++) { if (compound) bad += free_tail_pages_check(page, page + i); - if (static_branch_unlikely(&check_pages_enabled)) { + if (is_check_pages_enabled()) { if (unlikely(free_page_is_bad(page + i))) { bad++; continue; @@ -1456,7 +1461,7 @@ static __always_inline bool free_pages_prepare(struct page *page, page->mapping = NULL; if (memcg_kmem_online() && PageMemcgKmem(page)) __memcg_kmem_uncharge_page(page, order); - if (static_branch_unlikely(&check_pages_enabled)) { + if (is_check_pages_enabled()) { if (free_page_is_bad(page)) bad++; if (bad) @@ -2366,7 +2371,7 @@ static int check_new_page(struct page *page) static inline bool check_new_pages(struct page *page, unsigned int order) { - if (static_branch_unlikely(&check_pages_enabled)) { + if (is_check_pages_enabled()) { for (int i = 0; i < (1 << order); i++) { struct page *p = page + i;