From mboxrd@z Thu Jan 1 00:00:00 1970 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 D4B95C433EF for ; Tue, 29 Mar 2022 01:55:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E55C8D0002; Mon, 28 Mar 2022 21:55:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 495F08D0001; Mon, 28 Mar 2022 21:55:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 336078D0002; Mon, 28 Mar 2022 21:55:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0160.hostedemail.com [216.40.44.160]) by kanga.kvack.org (Postfix) with ESMTP id 253D88D0001 for ; Mon, 28 Mar 2022 21:55:11 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CC71318288A29 for ; Tue, 29 Mar 2022 01:55:10 +0000 (UTC) X-FDA: 79295755980.24.EAFCB5F Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf17.hostedemail.com (Postfix) with ESMTP id 9611A4000A for ; Tue, 29 Mar 2022 01:55:09 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KSCLL4R74zZfhb; Tue, 29 Mar 2022 09:54:50 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) 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.2308.21; Tue, 29 Mar 2022 09:55:06 +0800 Subject: Re: [PATCH 2/2] mm/vmscan: make sure wakeup_kswapd with managed zone To: Wei Yang CC: "Huang, Ying" , , , , References: <20220327024101.10378-1-richard.weiyang@gmail.com> <20220327024101.10378-2-richard.weiyang@gmail.com> <8735j2opd9.fsf@yhuang6-desk2.ccr.corp.intel.com> <8ff6f619-e04a-d785-fa9a-6822c04d4ee1@huawei.com> <20220329004535.27ps6cy4sipisxsu@master> From: Miaohe Lin Message-ID: <135cf5e8-4153-c0a9-70b8-f0a06713b550@huawei.com> Date: Tue, 29 Mar 2022 09:55:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20220329004535.27ps6cy4sipisxsu@master> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspam-User: X-Stat-Signature: 9om46ir7cighw9jokspngm8ks63hjk57 Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.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-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 9611A4000A X-HE-Tag: 1648518909-14470 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: On 2022/3/29 8:45, Wei Yang wrote: > On Mon, Mar 28, 2022 at 03:23:49PM +0800, Miaohe Lin wrote: >> On 2022/3/28 9:08, Huang, Ying wrote: >>> Hi, Wei, >>> >>> Wei Yang writes: >>> >>>> wakeup_kswapd() only wake up kswapd when the zone is managed. >>>> >>>> For two callers of wakeup_kswapd(), they are node perspective. >>>> >>>> * wake_all_kswapds >>>> * numamigrate_isolate_page >>>> >>>> If we picked up a !managed zone, this is not we expected. >>>> >>>> This patch makes sure we pick up a managed zone for wakeup_kswapd(). >>>> >>>> Signed-off-by: Wei Yang >>>> --- >>>> mm/migrate.c | 2 +- >>>> mm/page_alloc.c | 2 ++ >>>> 2 files changed, 3 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/mm/migrate.c b/mm/migrate.c >>>> index 3d60823afd2d..c4b654c0bdf0 100644 >>>> --- a/mm/migrate.c >>>> +++ b/mm/migrate.c >>>> @@ -2046,7 +2046,7 @@ static int numamigrate_isolate_page(pg_data_t *pgdat, struct page *page) >>>> if (!(sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING)) >>>> return 0; >>>> for (z = pgdat->nr_zones - 1; z >= 0; z--) { >>>> - if (populated_zone(pgdat->node_zones + z)) >>>> + if (managed_zone(pgdat->node_zones + z)) >>> >>> This looks good to me! Thanks! It seems that we can replace >>> populated_zone() in migrate_balanced_pgdat() too. Right? >> >> This patch looks good to me too. Thanks! >> >> BTW: This makes me remember the bewilderment when I read the relevant code. >> It's very kind of you if you could tell me the difference between >> managed_zone and populated_zone. IIUC, when the caller relies on the > > The difference is managed_zone means the zone has pages managed by buddy, > while populated_zone means the zone has pages but may be reserved. That's just what I understand. Thanks. :) > >> activity from buddy system, managed_zone should always be used. I think >> there're many places like compaction need to use managed_zone but >> populated_zone is used now. They might need to change to use managed_zone >> too. Or am I miss something? > > This thread comes from the read of commit 6aa303defb74, which adjust the > vmscan code. It looks like there is some mis-use in compaction, but I didn't > get time to go through it. I see. Thanks for the work. > >> >> Many Thanks. :) >