From patchwork Fri Sep 9 09:24:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971368 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 12A26ECAAA1 for ; Fri, 9 Sep 2022 09:25:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CBCE8D0005; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6B8B68D0007; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 559B48D0005; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 42DA68D0002 for ; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 14E6E1C6364 for ; Fri, 9 Sep 2022 09:25:30 +0000 (UTC) X-FDA: 79892014020.02.7C46331 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf08.hostedemail.com (Postfix) with ESMTP id 3ED15160087 for ; Fri, 9 Sep 2022 09:25:29 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MP9VN2BY0zmVDv; Fri, 9 Sep 2022 17:21:48 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:25 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 01/16] mm/page_alloc: ensure kswapd doesn't accidentally go to sleep Date: Fri, 9 Sep 2022 17:24:36 +0800 Message-ID: <20220909092451.24883-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715529; a=rsa-sha256; cv=none; b=Zp9sZnj8XTO75yqqm9LzK5/Jj+hyxi3vPdRcWzZH2gILa8Z4fpbM9qs0oLUNzo4QbyWWi2 JROOGd8oPr3BTJAS+ReGwL5fw1kV7gy1danm/GjXhUsFoPNUy8806xm+tpn2Nq8Q3vVAAN 4PEYQEkpWNbHUqMARwWZ+OQMebcrdKw= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715529; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=daC2cXG7zrZFjqSO0XVftvX+386KNf8k7c3qi0Xnvxw=; b=t/cKRwl5+pBpbb/Lmtu7igiBHmQuexMvomTZo+u/xDjf9yIvn5Up05SDd2nEatuIT4IYJO cSR20tfgPwFy46cTPuIr2CtqYZQi+qE4J7NVzRtdEPINoo4ln8N+4v5UVcrIFelgkETuU1 KzecHQ/w9yJ7wyRM3iIOLG87klJVL0s= Authentication-Results: imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Stat-Signature: aps33c1n361i8mdfrh5dzkd481a1un7c X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 3ED15160087 X-HE-Tag: 1662715529-526881 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: If ALLOC_KSWAPD is set, wake_all_kswapds() will be called to ensure kswapd doesn't accidentally go to sleep. But when reserve_flags is set, alloc_flags will be overwritten and ALLOC_KSWAPD is thus lost. Preserve the ALLOC_KSWAPD flag in alloc_flags to ensure kswapd won't go to sleep accidentally. Fixes: 0a79cdad5eb2 ("mm: use alloc_flags to record if kswapd can wake") Signed-off-by: Miaohe Lin Acked-by: David Hildenbrand Reviewed-by: Oscar Salvador --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ba5c9402a5cb..4b97a03fa2dd 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5147,7 +5147,8 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, reserve_flags = __gfp_pfmemalloc_flags(gfp_mask); if (reserve_flags) - alloc_flags = gfp_to_alloc_flags_cma(gfp_mask, reserve_flags); + alloc_flags = gfp_to_alloc_flags_cma(gfp_mask, reserve_flags) | + (alloc_flags & ALLOC_KSWAPD); /* * Reset the nodemask and zonelist iterators if memory policies can be From patchwork Fri Sep 9 09:24:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971369 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 C9C82C6FA82 for ; Fri, 9 Sep 2022 09:25:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A65D88D0007; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A140E8D0002; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7679C8D0008; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 633E58D0002 for ; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3CC5F14095D for ; Fri, 9 Sep 2022 09:25:30 +0000 (UTC) X-FDA: 79892014020.24.FC9CB46 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf25.hostedemail.com (Postfix) with ESMTP id 75DA1A00A4 for ; Fri, 9 Sep 2022 09:25:29 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MP9TM129gzZcm2; Fri, 9 Sep 2022 17:20:55 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:26 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 02/16] mm/page_alloc: make zone_pcp_update() static Date: Fri, 9 Sep 2022 17:24:37 +0800 Message-ID: <20220909092451.24883-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715529; a=rsa-sha256; cv=none; b=jOD9mXbN031JbLEkrG2mE9c2KtuIoh5wtDEaCMwSnKelCfeeJQiKxRD4AiwH2Qw8xlzRH6 R8pcalS3VKMzDQ0T771TlAGOW+eMgezMkICEbmo+4VqO3D+4KBUvx4r3ZJ3f17lJ+AbzEW 1pWhc3nB3K28NVyV2+XQSE52WPXQ36I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715529; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AoBsnKduntbJctiOOWEaPFOGsCHMQgUV9BVU3KA5QoY=; b=da07syTyzwfal+zd1SwESHZdgbX3aJOT166xEIsh9G5L12wTSZDSHmFle3GVqmoJd5qMxb 5dWz8KP9UYa6r6qPZoSH4fHFpBLPNje/ATlc505hBFOJJp3ju0ZxdnPKsv69Klqpj/7429 lsF8Z2BKBpD+9QaC8ujWN+azNrM3is4= Authentication-Results: imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Stat-Signature: w6a47ttk5xtc1gdtwrn51drxrq8ikttn X-Rspamd-Queue-Id: 75DA1A00A4 X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1662715529-238124 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: Since commit b92ca18e8ca5 ("mm/page_alloc: disassociate the pcp->high from pcp->batch"), zone_pcp_update() is only used in mm/page_alloc.c. Move zone_pcp_update() up to avoid forward declaration and then make it static. No functional change intended. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- mm/internal.h | 1 - mm/page_alloc.c | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 4e5f3d0d5538..2424fcde6538 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -367,7 +367,6 @@ extern int user_min_free_kbytes; extern void free_unref_page(struct page *page, unsigned int order); extern void free_unref_page_list(struct list_head *list); -extern void zone_pcp_update(struct zone *zone, int cpu_online); extern void zone_pcp_reset(struct zone *zone); extern void zone_pcp_disable(struct zone *zone); extern void zone_pcp_enable(struct zone *zone); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 4b97a03fa2dd..2deac2fe3372 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7238,6 +7238,17 @@ void __meminit setup_zone_pageset(struct zone *zone) zone_set_pageset_high_and_batch(zone, 0); } +/* + * The zone indicated has a new number of managed_pages; batch sizes and percpu + * page high values need to be recalculated. + */ +static void zone_pcp_update(struct zone *zone, int cpu_online) +{ + mutex_lock(&pcp_batch_high_lock); + zone_set_pageset_high_and_batch(zone, cpu_online); + mutex_unlock(&pcp_batch_high_lock); +} + /* * Allocate per cpu pagesets and initialize them. * Before this call only boot pagesets were available. @@ -9469,17 +9480,6 @@ void free_contig_range(unsigned long pfn, unsigned long nr_pages) } EXPORT_SYMBOL(free_contig_range); -/* - * The zone indicated has a new number of managed_pages; batch sizes and percpu - * page high values need to be recalculated. - */ -void zone_pcp_update(struct zone *zone, int cpu_online) -{ - mutex_lock(&pcp_batch_high_lock); - zone_set_pageset_high_and_batch(zone, cpu_online); - mutex_unlock(&pcp_batch_high_lock); -} - /* * Effectively disable pcplists for the zone by setting the high limit to 0 * and draining all cpus. A concurrent page freeing on another CPU that's about From patchwork Fri Sep 9 09:24:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971370 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 0DBC0C6FA86 for ; Fri, 9 Sep 2022 09:25:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 17421940008; Fri, 9 Sep 2022 05:25:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 077F28D0008; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E0B048D0002; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id BAC238D0008 for ; Fri, 9 Sep 2022 05:25:30 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8CE371209C8 for ; Fri, 9 Sep 2022 09:25:30 +0000 (UTC) X-FDA: 79892014020.17.C40A70A Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf15.hostedemail.com (Postfix) with ESMTP id E9DA0A007C for ; Fri, 9 Sep 2022 09:25:29 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MP9V80WYMz14QPh; Fri, 9 Sep 2022 17:21:36 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:26 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 03/16] mm: remove obsolete macro NR_PCP_ORDER_MASK Date: Fri, 9 Sep 2022 17:24:38 +0800 Message-ID: <20220909092451.24883-4-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715530; a=rsa-sha256; cv=none; b=3W/lVBjmPVMoOTlNRKkeu88jPzUz7p4OzwENKCtn6VfELUe+kuOkvfPO9mEkHUbh1CehTN jZ9c/R2Siex79ScXh5tl/7tfN97t5FiN5ocL9K2q5aV81JInYND7GOPacTdLxpIqt3J4HY UaHO5eHI2pEg5J87DrvFo9faqOOBqms= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715530; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XeGjWFmECwcI8jBbmSzZoSlkMIQ7zxPO0Jzu+aQG+i4=; b=JDP2wava5iMTdcH+Q+VlaJXxOxXPLlGM7LJmMMGnCwgJRLa743BvlPJxSP74r8KArP3kef XrRTvPa4BnQfO4sgGeLD8oIeea16oy/+TaRiyrofU5DGxBLCtRF8EG50NBV9jQ+g1xDtO4 cGlA7Gw7fTNYMEsXEraufMoRUfmfyaU= X-Stat-Signature: u5idre51fuoit9e118tqk489guh7udjq X-Rspamd-Queue-Id: E9DA0A007C X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam02 X-HE-Tag: 1662715529-169657 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: Since commit 8b10b465d0e1 ("mm/page_alloc: free pages in a single pass during bulk free"), it's not used anymore. Remove it. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- include/linux/mmzone.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index d907a29cc429..6950179a20a2 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -569,7 +569,6 @@ enum zone_watermarks { * in the least significant bits. */ #define NR_PCP_ORDER_WIDTH 8 -#define NR_PCP_ORDER_MASK ((1<_watermark[WMARK_MIN] + z->watermark_boost) #define low_wmark_pages(z) (z->_watermark[WMARK_LOW] + z->watermark_boost) From patchwork Fri Sep 9 09:24:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971371 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 5BF63ECAAD3 for ; Fri, 9 Sep 2022 09:25:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 841508D0002; Fri, 9 Sep 2022 05:25:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72F1A94000B; Fri, 9 Sep 2022 05:25:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B6B794000C; Fri, 9 Sep 2022 05:25:31 -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 0A1A8940007 for ; Fri, 9 Sep 2022 05:25:31 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D56BFC0B20 for ; Fri, 9 Sep 2022 09:25:30 +0000 (UTC) X-FDA: 79892014020.24.B836F50 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf26.hostedemail.com (Postfix) with ESMTP id 679761400A2 for ; Fri, 9 Sep 2022 09:25:30 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MP9V846HWz14QQr; Fri, 9 Sep 2022 17:21:36 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:27 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 04/16] mm/page_alloc: remove obsolete comment in zone_statistics() Date: Fri, 9 Sep 2022 17:24:39 +0800 Message-ID: <20220909092451.24883-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715530; a=rsa-sha256; cv=none; b=LSzJtoileRCjm1Yzc0YZbDXQKCyROFyV1VvTuXgcJ4Ccph+wXHggPX5nxeJlNIeHGvifyU GkZZelJa0rB9sxaNRLMEw/XNU/i7Iv99peGuB47F463OrunlF4l5osOXBH0ljh3bkJkx5S 57WDnRezfZBE1z2i1AhzL8vh3Gw3XuQ= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715530; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oshO+yMqt/g8R+2/jeWt+yl3o/JlZM80U1ZWIqtQFpE=; b=sR9sx3t/JFoa0VVzHlE/lns5Lv2ijKNKVRvvZJVOAONg1VRyYwP4gIDzXkz6mb3LZH0ocq R5FndnVmTQU+XFt7MaGYilZtqwTVOK9MC7l9Z0XaUogMO3JDODRLkb8NwHHMmBdPyHZzQr U+9ZfTwOYFjFrrI4RbCLd+CvviVoBmI= X-Rspamd-Server: rspam03 X-Rspam-User: X-Stat-Signature: hn788mb3begp7o5n4wzity9h1qwyzp3c X-Rspamd-Queue-Id: 679761400A2 Authentication-Results: imf26.hostedemail.com; dkim=none; spf=pass (imf26.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1662715530-437273 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: Since commit 43c95bcc51e4 ("mm/page_alloc: reduce duration that IRQs are disabled for VM counters"), zone_statistics() is not called with interrupts disabled. Update the corresponding comment. Signed-off-by: Miaohe Lin Acked-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- mm/page_alloc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2deac2fe3372..c81f06d8a4f5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3671,8 +3671,6 @@ void __putback_isolated_page(struct page *page, unsigned int order, int mt) /* * Update NUMA hit/miss statistics - * - * Must be called with interrupts disabled. */ static inline void zone_statistics(struct zone *preferred_zone, struct zone *z, long nr_account) From patchwork Fri Sep 9 09:24:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971374 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 7FD0CC6FA82 for ; Fri, 9 Sep 2022 09:25:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 75BC294000B; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CEB48D0003; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44772940007; Fri, 9 Sep 2022 05:25:32 -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 28B6C8D000B for ; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E991DAB344 for ; Fri, 9 Sep 2022 09:25:31 +0000 (UTC) X-FDA: 79892014062.26.D6DF39B Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf03.hostedemail.com (Postfix) with ESMTP id 4061A20073 for ; Fri, 9 Sep 2022 09:25:31 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MP9Wb5xM9znVBC; Fri, 9 Sep 2022 17:22:51 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:27 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 05/16] mm/page_alloc: add __init annotations to init_mem_debugging_and_hardening() Date: Fri, 9 Sep 2022 17:24:40 +0800 Message-ID: <20220909092451.24883-6-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715531; a=rsa-sha256; cv=none; b=aFUCzehWoj/efv3VpWtIUFvwk2l3l7WP7nX2PLIiKhPw7lnDg3784SU80CfAHyNgZ7mFu6 GVKa57LsbYP7wRCXkMMNCAjDlNF+eFirEnATfecIpxnK07En9JkaWroUsbPdX7XpV4Mm/H 6u1k8Kr+7j5hrB7wwBbsZmdMIF0SmLY= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715531; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BsdEgiIXH29TQyM4Lux2WCwNCt4hpS8ehaWLbizfKEY=; b=o2Kkt76LzcK0N/6F88R2SEtkQpgNPmiTb8ewwghoM65mQX6Tqh6lRwp5qAWU1H9mGugtgA oIaqkvr4Z5nXNex007azep41ZP09feWhxNfJ6DZTVfVFpIa78+D1Oe4dLPe7fBYRhcWUV/ +LqHIsBCwtDo6mA8Pi5AqtF3KRdje24= X-Rspamd-Server: rspam03 X-Rspam-User: X-Stat-Signature: 98p8a7119bqk3gyzzuukj4h8m5qyjuhz X-Rspamd-Queue-Id: 4061A20073 Authentication-Results: imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1662715531-64330 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: It's only called by mm_init(). Add __init annotations to it. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- include/linux/mm.h | 2 +- mm/page_alloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 364bcadb4d20..c2277f5aba9e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3093,7 +3093,7 @@ extern int apply_to_existing_page_range(struct mm_struct *mm, unsigned long address, unsigned long size, pte_fn_t fn, void *data); -extern void init_mem_debugging_and_hardening(void); +extern void __init init_mem_debugging_and_hardening(void); #ifdef CONFIG_PAGE_POISONING extern void __kernel_poison_pages(struct page *page, int numpages); extern void __kernel_unpoison_pages(struct page *page, int numpages); diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c81f06d8a4f5..3497919f4ef5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -903,7 +903,7 @@ static inline void clear_page_guard(struct zone *zone, struct page *page, * order of appearance. So we need to first gather the full picture of what was * enabled, and then make decisions. */ -void init_mem_debugging_and_hardening(void) +void __init init_mem_debugging_and_hardening(void) { bool page_poisoning_requested = false; From patchwork Fri Sep 9 09:24:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971373 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 43D97C6FA86 for ; Fri, 9 Sep 2022 09:25:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E288E8D0009; Fri, 9 Sep 2022 05:25:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A8A6094000C; Fri, 9 Sep 2022 05:25:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 842658D0008; Fri, 9 Sep 2022 05:25:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 581398D0002 for ; Fri, 9 Sep 2022 05:25:31 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 310E814095D for ; Fri, 9 Sep 2022 09:25:31 +0000 (UTC) X-FDA: 79892014062.12.58E0583 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf24.hostedemail.com (Postfix) with ESMTP id A46DE1800A7 for ; Fri, 9 Sep 2022 09:25:30 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MP9TN6FrnzZcnt; Fri, 9 Sep 2022 17:20:56 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:27 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 06/16] mm/page_alloc: fix freeing static percpu memory Date: Fri, 9 Sep 2022 17:24:41 +0800 Message-ID: <20220909092451.24883-7-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715530; a=rsa-sha256; cv=none; b=WCFcFUJcWW5/zMB+X9etjfDnY2R2z0G/UiRIvO5i+saNCxpMrcrDrC5v3yJ4z6IiKdAQKk yESVtVSHKgnzzb03le3UBoIzgAQv30LH3QTp/VGONKrIv+GdOug26Eh/dxcLORuKIpFHk2 MGgOVimWQrU/mYZ3GQz9Ek8ocL0lZ1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715530; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9HYcUGaGK/rNI8r2JbsD0klLxs3ZEExzxOON574yzO4=; b=A5v3/PCtcOtiM8vxSHxvaeX8+5b9836ugMmcK/mihJYanq4w4qpvw2clbu2uhZsWgPhuSU FfMfgK1+woRhiV2h9rOo9cl2J8YJDJgThK1dHnicXHTo5w6ggu7Fh8QO2Ftp3jovrJf2tb 8yI8CDJLtEL9FUo2ZenVBgxQJhRPlFU= Authentication-Results: imf24.hostedemail.com; dkim=none; spf=pass (imf24.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Stat-Signature: tq5eqcor5d6cukkks5zqbtfoe8qhxxdr X-Rspamd-Queue-Id: A46DE1800A7 X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1662715530-229680 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 size of struct per_cpu_zonestat can be 0 on !SMP && !NUMA. In that case, zone->per_cpu_zonestats will always equal to boot_zonestats. But in zone_pcp_reset(), zone->per_cpu_zonestats is freed via free_percpu() directly without checking against boot_zonestats first. boot_zonestats will be released by free_percpu() unexpectedly. Fixes: 28f836b6777b ("mm/page_alloc: split per cpu page lists and zone stats") Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador --- mm/page_alloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3497919f4ef5..a35ef385d906 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -9510,9 +9510,11 @@ void zone_pcp_reset(struct zone *zone) drain_zonestat(zone, pzstats); } free_percpu(zone->per_cpu_pageset); - free_percpu(zone->per_cpu_zonestats); zone->per_cpu_pageset = &boot_pageset; - zone->per_cpu_zonestats = &boot_zonestats; + if (zone->per_cpu_zonestats != &boot_zonestats) { + free_percpu(zone->per_cpu_zonestats); + zone->per_cpu_zonestats = &boot_zonestats; + } } } From patchwork Fri Sep 9 09:24:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971375 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 D5A9AECAAA1 for ; Fri, 9 Sep 2022 09:25:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 996998D0003; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7570B940007; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55EC494000C; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 267828D000A for ; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 02C8AAB345 for ; Fri, 9 Sep 2022 09:25:31 +0000 (UTC) X-FDA: 79892014104.24.3820159 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf09.hostedemail.com (Postfix) with ESMTP id 4E27E140090 for ; Fri, 9 Sep 2022 09:25:31 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MP9V93JMVzlVqK; Fri, 9 Sep 2022 17:21:37 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:28 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 07/16] mm: remove obsolete pgdat_is_empty() Date: Fri, 9 Sep 2022 17:24:42 +0800 Message-ID: <20220909092451.24883-8-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715531; a=rsa-sha256; cv=none; b=oFgapB31DyBop1/NP8qltJSDMuV1cU1qQNECx3Z+HgAHDrVhh9USjAGKZEs+ICGxz9sDXv sGg6qyOK1zQG7tegMLJC6eNbuP5twhNthmUK8MDAdzE/d/06AhSIi8N/mJHPqIkaejP5ZE pLUpTDZ8wSTtS1rtLrGPS62TN47fzQQ= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715531; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uIta2MZvnLfWPHcQLECdsaoobcqvqhvz8sDiIHqzBuk=; b=TV5ssMdX4yvAuy+N+VhUwu0LeU1W8mBOVYp7cyD+wDNDibwHAzT0HF0+EE2qLUESdPpdRl GidZevvMSajR/N5iZUQZMknMmMQfJ6vNggB1ayfO+NRQVnuG7Qs15SPjrkmYPmyQWqIT3l FIXuk6REYYb9ob504Qp4rLBcPyWlH2I= Authentication-Results: imf09.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf09.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspam-User: X-Rspamd-Queue-Id: 4E27E140090 X-Rspamd-Server: rspam09 X-Stat-Signature: d7oi6o1nmpa96xtc9k34qaxwogtp38o6 X-HE-Tag: 1662715531-5674 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: There's no caller. Remove it. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- include/linux/mmzone.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 6950179a20a2..ab17a0e6f26f 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -1247,11 +1247,6 @@ static inline unsigned long pgdat_end_pfn(pg_data_t *pgdat) return pgdat->node_start_pfn + pgdat->node_spanned_pages; } -static inline bool pgdat_is_empty(pg_data_t *pgdat) -{ - return !pgdat->node_start_pfn && !pgdat->node_spanned_pages; -} - #include void build_all_zonelists(pg_data_t *pgdat); From patchwork Fri Sep 9 09:24:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971376 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 329ABECAAD3 for ; Fri, 9 Sep 2022 09:25:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CAF82940007; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BC87E8D000A; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DB4794000C; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4A68F94000B for ; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 23B3A120B00 for ; Fri, 9 Sep 2022 09:25:32 +0000 (UTC) X-FDA: 79892014104.17.B7C1342 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf16.hostedemail.com (Postfix) with ESMTP id 874E718007F for ; Fri, 9 Sep 2022 09:25:31 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MP9V96Vw2zlVnt; Fri, 9 Sep 2022 17:21:37 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:28 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 08/16] mm/page_alloc: add missing is_migrate_isolate() check in set_page_guard() Date: Fri, 9 Sep 2022 17:24:43 +0800 Message-ID: <20220909092451.24883-9-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715531; a=rsa-sha256; cv=none; b=ddGoCdlUJDF+Vg2mWkQ0mLaPCgS02LvXFICrXpltVxmOmgoR3sDDeFsAtoadqFHecs+4wh laBtbuGu2ots/ePPWfapVfxEXNk3jT2kUhQiUUr85HtS80fn3/FnaC0hfFKMrWoxLKgb0K woicqcdWIB0O0uPp4QGop7vN0ofi4Tw= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf16.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715531; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YVVTr0RqI3YnuTSfe3vXnfsVLNPKWXIWLmHR02GsolM=; b=5gt0wQAQV5d4nKLdi2TyY06iJym257ljIHxF3SIU5MnwRObe1iZE+cX9+GkCNnO6BHSAem /frN3rzwIb/wQU4Mqjbi5TlmuvoKbzY6PxAXgwWFnZEQwF3EyIxuSjV8FRO6+8PWOJxhSu YfyHACQORDTAEoRSzfOnaSy1WmsyHEw= X-Stat-Signature: 3m7mzaruzgrh9j47ksjpj7nn4bygs94b X-Rspamd-Queue-Id: 874E718007F X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf16.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam12 X-HE-Tag: 1662715531-337627 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: In MIGRATE_ISOLATE case, zone freepage state shouldn't be modified as caller will take care of it. Add missing is_migrate_isolate() here to avoid possible unbalanced freepage state. Signed-off-by: Miaohe Lin Reviewed-by: Oscar Salvador --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a35ef385d906..94baf33da865 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -873,7 +873,8 @@ static inline bool set_page_guard(struct zone *zone, struct page *page, INIT_LIST_HEAD(&page->buddy_list); set_page_private(page, order); /* Guard pages are not available for any usage */ - __mod_zone_freepage_state(zone, -(1 << order), migratetype); + if (!is_migrate_isolate(migratetype)) + __mod_zone_freepage_state(zone, -(1 << order), migratetype); return true; } From patchwork Fri Sep 9 09:24:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971377 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 A21FFC6FA82 for ; Fri, 9 Sep 2022 09:25:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EB828D000A; Fri, 9 Sep 2022 05:25:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2722D94000C; Fri, 9 Sep 2022 05:25:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 161218D000A; Fri, 9 Sep 2022 05:25:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id EE8CE94000C for ; Fri, 9 Sep 2022 05:25:32 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D2DA7C0B2A for ; Fri, 9 Sep 2022 09:25:32 +0000 (UTC) X-FDA: 79892014104.02.819608D Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf19.hostedemail.com (Postfix) with ESMTP id 551111A0064 for ; Fri, 9 Sep 2022 09:25:32 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MP9XN6KgCzHnpY; Fri, 9 Sep 2022 17:23:32 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:29 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 09/16] mm/page_alloc: use local variable zone_idx directly Date: Fri, 9 Sep 2022 17:24:44 +0800 Message-ID: <20220909092451.24883-10-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715532; a=rsa-sha256; cv=none; b=UBgoVKDsEAO3GQLWfmSOSsWZX6s+T+Gkeg49hinxTW6iXnp+gr6tHqRNlSMXt8UR/ddqVM fh0zxSjD6NtVDBlnkRi6rD3iWm/EEFCHh9kySAF/nevCOhLLTlV94Mj7huD/7YiKbD3IMp 5ZAlQzlJEsIqNEhk5Gz+Fj553+tdVjA= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715532; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YrO8dXy2fVaWQ4h00uJXekWpWlIwrOmxKZnSx6oDZ7I=; b=LKVyaPBJ0fptVIVFUW+BZEAlpZrGquBDA8zhaIsM3R+6EiO5nxncyLVer1jsHTIRK3pfsd DMKbBE/W3ItUbBp77r54Kce+UWhPnRLXnPblJpFq1zKfLBpF0wGnveILDdRpZXlNSCrwqm Sw+gVLd8SAqRhxHBOpFV0Xtoj7LfMxU= X-Stat-Signature: bi9xk3g65rzt13jgba4x741ya4fek87u X-Rspamd-Queue-Id: 551111A0064 X-Rspamd-Server: rspam11 X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1662715532-406325 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: Use local variable zone_idx directly since it holds the exact value of zone_idx(). No functional change intended. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 94baf33da865..3417232afa45 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6878,7 +6878,7 @@ void __ref memmap_init_zone_device(struct zone *zone, unsigned long start = jiffies; int nid = pgdat->node_id; - if (WARN_ON_ONCE(!pgmap || zone_idx(zone) != ZONE_DEVICE)) + if (WARN_ON_ONCE(!pgmap || zone_idx != ZONE_DEVICE)) return; /* From patchwork Fri Sep 9 09:24:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971378 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 0392DECAAA1 for ; Fri, 9 Sep 2022 09:25:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4742C94000F; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 312458D000B; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 077FB8D000C; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CD9D48D000B for ; Fri, 9 Sep 2022 05:25:33 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A86C8A0418 for ; Fri, 9 Sep 2022 09:25:33 +0000 (UTC) X-FDA: 79892014146.09.34298F8 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf05.hostedemail.com (Postfix) with ESMTP id E8C0B10008B for ; Fri, 9 Sep 2022 09:25:32 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MP9VB5mFCzlVkQ; Fri, 9 Sep 2022 17:21:38 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:29 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 10/16] mm, memory_hotplug: remove obsolete generic_free_nodedata() Date: Fri, 9 Sep 2022 17:24:45 +0800 Message-ID: <20220909092451.24883-11-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715533; a=rsa-sha256; cv=none; b=clu+WTc3WHM7OBmJN62xqLj1Whyy+oX5bT+KxomC76xV7RBAEA6tMKg7JoG1x11FTafORk iHYWN2nsGTE3SiH8aK/nOnE2lRVpj99z5YQdWe0J14JCYRZedmARkCouaABYpKwuz0PLPF MMv0rGAsXdFHMMgqommKQYM0qGgOfgc= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715533; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i+y8e5vM5t6PX1ymVdtI3lyI5IhhCGz1BnO/+UEbMEo=; b=cAyJqIU1gH2se0lOPL1Gj7qOZsl8isrB1Vv90Q3CRW3nMEd+Oi+PZ2mztUKhFZMjWIaUIe dUTtnuW7NDVarmUKH/jpIyETBLRygaJcqLJrOjppEA4TdbnwN2SLY339nygIUXsD1Sj6lQ wvwo+bbwWejTDaP8QISHvwuE8eFfBoI= X-Stat-Signature: gw5t6h3qrtxd5bhdehdzt1pd47d7iowu X-Rspamd-Queue-Id: E8C0B10008B X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf05.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam12 X-HE-Tag: 1662715532-320509 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: Commit 390511e1476e ("mm, memory_hotplug: drop arch_free_nodedata") drops the last caller of generic_free_nodedata(). Remove it too. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- include/linux/memory_hotplug.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 51052969dbfe..9fcbf5706595 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -43,11 +43,6 @@ extern void arch_refresh_nodedata(int nid, pg_data_t *pgdat); ({ \ memblock_alloc(sizeof(*pgdat), SMP_CACHE_BYTES); \ }) -/* - * This definition is just for error path in node hotadd. - * For node hotremove, we have to replace this. - */ -#define generic_free_nodedata(pgdat) kfree(pgdat) extern pg_data_t *node_data[]; static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) @@ -63,9 +58,6 @@ static inline pg_data_t *generic_alloc_nodedata(int nid) BUG(); return NULL; } -static inline void generic_free_nodedata(pg_data_t *pgdat) -{ -} static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) { } From patchwork Fri Sep 9 09:24:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971379 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 6612EC6FA82 for ; Fri, 9 Sep 2022 09:25:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7634D8D000B; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4711294000E; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 299C494000D; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 08F6C94000C for ; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id DD7C8120AF9 for ; Fri, 9 Sep 2022 09:25:33 +0000 (UTC) X-FDA: 79892014146.11.27A1DB0 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf12.hostedemail.com (Postfix) with ESMTP id 62C484009C for ; Fri, 9 Sep 2022 09:25:33 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MP9VC1sbRzlVql; Fri, 9 Sep 2022 17:21:39 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:30 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 11/16] mm/page_alloc: make boot_nodestats static Date: Fri, 9 Sep 2022 17:24:46 +0800 Message-ID: <20220909092451.24883-12-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715533; a=rsa-sha256; cv=none; b=24Zw9bbloczjK9yayO+CiRRvkxVxoj8fwkQGr1wfBUyvua1zEvNEiQt2X+ijU+f+j+PRJz dbW25KWlBo5iDsF/GTrHkNXxfde8LO1gGF4udVey8/7fPHQDhM+218y9yWN3j9DLE8ssx4 oEx1JQFogaxC39O6XOcd1xVdjMfZQZc= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715533; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BN9uf8xdaS+loBiDJjdzFGJsztRi5MlWQBfMkdnnpo4=; b=iVSUNH9zptsdKueVe697/4jKW/uZagKsBQ50C4cb6acTR4d+Jy3XNapRBnaKWhzaGUpbVj ZDpm3TnnkIABrBAx74AK3jnaaTMJvud1bNr6XGn31zFGHPeyyepAUG2k+q+zaZOFy66mwu s6mzWvPPnXdutTfPJlyO4ejW34Ufdfw= X-Stat-Signature: tgbhkg4kitz8uitqa1zrmmq9pj3bka6f X-Rspam-User: X-Rspamd-Queue-Id: 62C484009C X-Rspamd-Server: rspam07 Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1662715533-130792 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: It's only used in mm/page_alloc.c now. Make it static. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- mm/internal.h | 2 -- mm/page_alloc.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 2424fcde6538..43a441d35baf 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -864,8 +864,6 @@ int migrate_device_coherent_page(struct page *page); */ struct folio *try_grab_folio(struct page *page, int refs, unsigned int flags); -DECLARE_PER_CPU(struct per_cpu_nodestat, boot_nodestats); - extern bool mirrored_kernelcore; static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 3417232afa45..7a8a6bb08a15 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6571,7 +6571,7 @@ static void per_cpu_pages_init(struct per_cpu_pages *pcp, struct per_cpu_zonesta #define BOOT_PAGESET_BATCH 1 static DEFINE_PER_CPU(struct per_cpu_pages, boot_pageset); static DEFINE_PER_CPU(struct per_cpu_zonestat, boot_zonestats); -DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats); +static DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats); static void __build_all_zonelists(void *data) { From patchwork Fri Sep 9 09:24:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971380 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 DD6B4ECAAA1 for ; Fri, 9 Sep 2022 09:25:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A24CA94000C; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A1C78D000D; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6954094000D; Fri, 9 Sep 2022 05:25:34 -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 3B7FE94000C for ; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 17DB6AB30E for ; Fri, 9 Sep 2022 09:25:34 +0000 (UTC) X-FDA: 79892014188.18.9001DE9 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP id 99BEA4009E for ; Fri, 9 Sep 2022 09:25:33 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MP9TR40wbzZcGs; Fri, 9 Sep 2022 17:20:59 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:30 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 12/16] mm/page_alloc: use helper macro SZ_1{K,M} Date: Fri, 9 Sep 2022 17:24:47 +0800 Message-ID: <20220909092451.24883-13-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715533; a=rsa-sha256; cv=none; b=XFwLcjC7D7+HvtIztS91PWddXMqW6c+c8Tcud17U1q30ayP25hpntuhF3uBShrXXQgNrtp mi9h+svbrNmwMLUkkSZhHnu0e6n3NhJYk1goGkZCCyIsjD3RiSRmqyUKS9IkNdTKV+iexh vtxSFpjJfil5Y7fvDdijxMwX8smZ7+c= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715533; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zMZKS49qLPY8uL0uUc26L90u2SGQ2t5C5EAzgdWlTE4=; b=zJJ87WCzIiwWmMOjKKmbfXWWufy0WbZoh9X35o5PtObLVNEFn5tfigQ4aNLT8omv3SUrtg orSV2/o8KhRcSo0Taufhn07cesOtfBb5dCpQYl1BtXS0QU7yWK87Q1ekAOOH6mQtkU/5JC q8CKiOf6Ewl+IMPyfS0MNdJKMfmoCmk= X-Rspamd-Queue-Id: 99BEA4009E Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: cc17ip53ct3o1im43qe5kauo5zkr5m97 X-HE-Tag: 1662715533-848167 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: Use helper macro SZ_1K and SZ_1M to do the size conversion. Minor readability improvement. Signed-off-by: Miaohe Lin --- mm/page_alloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7a8a6bb08a15..e1c7f98cff96 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7053,7 +7053,7 @@ static int zone_batchsize(struct zone *zone) * size is striking a balance between allocation latency * and zone lock contention. */ - batch = min(zone_managed_pages(zone) >> 10, (1024 * 1024) / PAGE_SIZE); + batch = min(zone_managed_pages(zone) >> 10, SZ_1M / PAGE_SIZE); batch /= 4; /* We effectively *= 4 below */ if (batch < 1) batch = 1; @@ -8528,8 +8528,8 @@ void __init mem_init_print_info(void) #endif ")\n", K(nr_free_pages()), K(physpages), - codesize >> 10, datasize >> 10, rosize >> 10, - (init_data_size + init_code_size) >> 10, bss_size >> 10, + codesize / SZ_1K, datasize / SZ_1K, rosize / SZ_1K, + (init_data_size + init_code_size) / SZ_1K, bss_size / SZ_1K, K(physpages - totalram_pages() - totalcma_pages), K(totalcma_pages) #ifdef CONFIG_HIGHMEM @@ -9055,7 +9055,7 @@ void *__init alloc_large_system_hash(const char *tablename, /* It isn't necessary when PAGE_SIZE >= 1MB */ if (PAGE_SHIFT < 20) - numentries = round_up(numentries, (1<<20)/PAGE_SIZE); + numentries = round_up(numentries, SZ_1M / PAGE_SIZE); #if __BITS_PER_LONG > 32 if (!high_limit) { From patchwork Fri Sep 9 09:24:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971381 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 57465ECAAD3 for ; Fri, 9 Sep 2022 09:25:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 05423940010; Fri, 9 Sep 2022 05:25:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E84EF94000E; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C38F494000D; Fri, 9 Sep 2022 05:25:34 -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 96A988D000C for ; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7968F40A46 for ; Fri, 9 Sep 2022 09:25:34 +0000 (UTC) X-FDA: 79892014188.29.EB46645 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf30.hostedemail.com (Postfix) with ESMTP id DDB6C800A3 for ; Fri, 9 Sep 2022 09:25:33 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MP9TS02pRzZcmJ; Fri, 9 Sep 2022 17:21:00 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:31 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 13/16] mm/page_alloc: init local variable buddy_pfn Date: Fri, 9 Sep 2022 17:24:48 +0800 Message-ID: <20220909092451.24883-14-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715534; a=rsa-sha256; cv=none; b=x9v78DsOrz+ombeb2Fj9PKoraOUazrV/N3nOb/Kd+F6kUWqKtiNtG/rvp0JEb6hGfoBtv3 7i0uJZFSyIyGHQvovri+pzHGVpGaYQXWM4c5R2jPeLcq76y4sJJxiPdWjacT8IGJICLajG F+W50gsNo1eaQqLRz9yoq6nzuEEhFlo= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715534; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lGorzbx2/799i8C3hn9fMwaX24G2PgzNoWDpcLkVKzc=; b=BH4YFqsvXxmEOxTLyOtOGPs65vAY8sQc7Ow/AxLgzRWk2awzBMUiDye87ypYGfIaZc9v2Z h/0J0qHfBFTcZK3m9Kbysy6cm6GkZ6Kk+r6sUOKLP51OtR2ZwbcF1swQBQNqz2q2G7f/DT xS1uv1YiQz4tlchYsNayAWSthDXGaV4= Authentication-Results: imf30.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf30.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspam-User: X-Rspamd-Queue-Id: DDB6C800A3 X-Rspamd-Server: rspam09 X-Stat-Signature: obqki3rd44x4zt1tit565k3sse83h638 X-HE-Tag: 1662715533-479637 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 local variable buddy_pfn could be passed to buddy_merge_likely() without initialization if the passed in order is MAX_ORDER - 1. This looks buggy but buddy_pfn won't be used in this case as there's a order >= MAX_ORDER - 2 check. Init buddy_pfn to 0 anyway to avoid possible future misuse. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e1c7f98cff96..63ad25e86010 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1113,7 +1113,7 @@ static inline void __free_one_page(struct page *page, int migratetype, fpi_t fpi_flags) { struct capture_control *capc = task_capc(zone); - unsigned long buddy_pfn; + unsigned long buddy_pfn = 0; unsigned long combined_pfn; struct page *buddy; bool to_tail; From patchwork Fri Sep 9 09:24:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971382 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 EB036C6FA86 for ; Fri, 9 Sep 2022 09:25:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 44A498D000D; Fri, 9 Sep 2022 05:25:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D4828D000C; Fri, 9 Sep 2022 05:25:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0518194000D; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DE2CD8D000C for ; Fri, 9 Sep 2022 05:25:34 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B3C04A0462 for ; Fri, 9 Sep 2022 09:25:34 +0000 (UTC) X-FDA: 79892014188.23.D843E0E Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf20.hostedemail.com (Postfix) with ESMTP id 422341C009F for ; Fri, 9 Sep 2022 09:25:34 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MP9VV0TtdzmV9d; Fri, 9 Sep 2022 17:21:54 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:31 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 14/16] mm/page_alloc: use costly_order in WARN_ON_ONCE_GFP() Date: Fri, 9 Sep 2022 17:24:49 +0800 Message-ID: <20220909092451.24883-15-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715534; a=rsa-sha256; cv=none; b=5Ya33QJ3xXzMpwFvWmeDVGREtRrp6OaFjkpaYM7WOQR3D9C3AslF0mlpzkVohKjcwgJsIn WV5bqW084UARKDaumefcEjr3qqC9+83iAtqxBmep1qmuW++Kq/kuGUkFkeMY4mL2ddUBND Ieek3qz3XREcE6TVKpNYzljs8f/SUG4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715534; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/4c0ej5WbB3FlbBRH3iLmiyHR/dTVgllmwFl0dVweck=; b=s7PLLJFIsrUQBMA6J/g9IApT8W1zAx0+yby+iExM3th9E2UsXhgMIVmJACDiiNFADWg9jC hE/wN0ssUj++zqgPNTNjZJnHdhp/ifof1tZ3ZBduXsVtN2xOYRurlH2exjWAkX3ZVU4iMh hWpicZOrcIMXTgBbUJtFU6YI5A4x6MA= Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspam-User: X-Rspamd-Server: rspam01 X-Stat-Signature: 9nguag7zq94b4h6itrfpx6tpr8fkd7au X-Rspamd-Queue-Id: 422341C009F X-HE-Tag: 1662715534-976603 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: There's no need to check whether order > PAGE_ALLOC_COSTLY_ORDER again. Minor readability improvement. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 63ad25e86010..262e8972e019 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5272,7 +5272,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, * so that we can identify them and convert them to something * else. */ - WARN_ON_ONCE_GFP(order > PAGE_ALLOC_COSTLY_ORDER, gfp_mask); + WARN_ON_ONCE_GFP(costly_order, gfp_mask); /* * Help non-failing allocations by giving them access to memory From patchwork Fri Sep 9 09:24:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971383 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 B5505ECAAD3 for ; Fri, 9 Sep 2022 09:25:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ADAA68D000E; Fri, 9 Sep 2022 05:25:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9EDC58D000C; Fri, 9 Sep 2022 05:25:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 818C380007; Fri, 9 Sep 2022 05:25:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5CA138D000E for ; Fri, 9 Sep 2022 05:25:35 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 30BE9160B35 for ; Fri, 9 Sep 2022 09:25:35 +0000 (UTC) X-FDA: 79892014230.25.FD47DF9 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf10.hostedemail.com (Postfix) with ESMTP id A22C6C0072 for ; Fri, 9 Sep 2022 09:25:34 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MP9VV3gN1zmVLC; Fri, 9 Sep 2022 17:21:54 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:32 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 15/16] mm/page_alloc: remove obsolete gfpflags_normal_context() Date: Fri, 9 Sep 2022 17:24:50 +0800 Message-ID: <20220909092451.24883-16-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715534; a=rsa-sha256; cv=none; b=VLO5b0qC20gQf4s3mnEm7joPgNtLNYXEbiUS9WcA0ZPV7zLSoSLp9KQxXtyJot7BNHslel VjUmjFK5z2NjGiPmlLJcCPDS2khvVPBt2btaJM5lHpLRiEfWbqor1kKo5qTIVNvdi8/x6u O5f1RyMKBfZN45XrKGBDa2+9JS/R9tc= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715534; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BUMlZw6v2VQHO3kIXYxVT43Kt053GgvJnVheJx67OSE=; b=szcJYuoa4cUEl/6MpY75vnu7ZseZh55LrWP9bnPKKmlF670ezDgpHXS4+bn1wZDZEXX0ui H+mNjGvnNxQbjzZJyw+PafZg7y1b95Wf1CedeY0K+wHeVJtCTIEnuFIY/Na6BHCD+mupk7 Cca0kq8SgH7ooA3c6lt6F7SAbV0GSZk= Authentication-Results: imf10.hostedemail.com; dkim=none; spf=pass (imf10.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Stat-Signature: c4ph45fpgm1h3ajujzjwom45c3zfnykf X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: A22C6C0072 X-HE-Tag: 1662715534-313336 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: Since commit dacb5d8875cc ("tcp: fix page frag corruption on page fault"), there's no caller of gfpflags_normal_context(). Remove it as this helper is strictly tied to the sk page frag usage and there won't be other user in the future. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- include/linux/gfp.h | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/include/linux/gfp.h b/include/linux/gfp.h index ea6cb9399152..ef4aea3b356e 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -36,29 +36,6 @@ static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags) return !!(gfp_flags & __GFP_DIRECT_RECLAIM); } -/** - * gfpflags_normal_context - is gfp_flags a normal sleepable context? - * @gfp_flags: gfp_flags to test - * - * Test whether @gfp_flags indicates that the allocation is from the - * %current context and allowed to sleep. - * - * An allocation being allowed to block doesn't mean it owns the %current - * context. When direct reclaim path tries to allocate memory, the - * allocation context is nested inside whatever %current was doing at the - * time of the original allocation. The nested allocation may be allowed - * to block but modifying anything %current owns can corrupt the outer - * context's expectations. - * - * %true result from this function indicates that the allocation context - * can sleep and use anything that's associated with %current. - */ -static inline bool gfpflags_normal_context(const gfp_t gfp_flags) -{ - return (gfp_flags & (__GFP_DIRECT_RECLAIM | __GFP_MEMALLOC)) == - __GFP_DIRECT_RECLAIM; -} - #ifdef CONFIG_HIGHMEM #define OPT_ZONE_HIGHMEM ZONE_HIGHMEM #else From patchwork Fri Sep 9 09:24:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12971384 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 D5E56ECAAD3 for ; Fri, 9 Sep 2022 09:25:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EE3D80008; Fri, 9 Sep 2022 05:25:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2766B80007; Fri, 9 Sep 2022 05:25:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13CB980008; Fri, 9 Sep 2022 05:25:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E3D4C80007 for ; Fri, 9 Sep 2022 05:25:35 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B80491209B7 for ; Fri, 9 Sep 2022 09:25:35 +0000 (UTC) X-FDA: 79892014230.16.C0FBD9E Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf19.hostedemail.com (Postfix) with ESMTP id 3045F1A0064 for ; Fri, 9 Sep 2022 09:25:34 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MP9VF6LxPz14QMg; Fri, 9 Sep 2022 17:21:41 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 9 Sep 2022 17:25:32 +0800 From: Miaohe Lin To: CC: , , , , Subject: [PATCH 16/16] mm/page_alloc: fix obsolete comment in deferred_pfn_valid() Date: Fri, 9 Sep 2022 17:24:51 +0800 Message-ID: <20220909092451.24883-17-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220909092451.24883-1-linmiaohe@huawei.com> References: <20220909092451.24883-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662715535; a=rsa-sha256; cv=none; b=19THQMkH488YVcM5iEPReWuD2hH5+dhwZZRjaoycc0S6cWo/BYP/BrrNBi0ZxskG7Xapog jfywowVR+fKmxJbJlkkf/j3l8UO5JyGBsy6w7ljTTI/j8PDH42AoG4eeUP40h5s+lBPRx7 mmCpFmiCHBNStHjKdDSfZPMQkk0FVPY= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662715535; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bNGFGqFklJ+pmLbiqmbaNHlp+lsEPj9bnosN9vpHVhU=; b=gSpNCN3ZbqwqmIJUQ+fVKKlBXyqwISN+TXkf13/+YHvCrzEuCqHnutyqeqPMpPrwfyX8tI ahEIWFY+BGbJdsrMXKRAvbxgCetgWFyMQ/AjHN00FLYO1L5aqIQxxvVmu1wuUyTzFqTcsc 6Gh2U7MNHgsNy27ocJPKVVHAMjQWIYg= X-Stat-Signature: 8tfmqjps6584eedbo13ypep9ykhfefgu X-Rspamd-Queue-Id: 3045F1A0064 X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam12 X-HE-Tag: 1662715534-849570 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: There are no architectures that can have holes in the memory map within a pageblock since commit 859a85ddf90e ("mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE"). Update the corresponding comment. Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador --- mm/page_alloc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 262e8972e019..4cc0232020d2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1929,11 +1929,7 @@ static inline void __init pgdat_init_report_one_done(void) /* * Returns true if page needs to be initialized or freed to buddy allocator. * - * First we check if pfn is valid on architectures where it is possible to have - * holes within pageblock_nr_pages. On systems where it is not possible, this - * function is optimized out. - * - * Then, we check if a current large page is valid by only checking the validity + * We check if a current large page is valid by only checking the validity * of the head pfn. */ static inline bool __init deferred_pfn_valid(unsigned long pfn)