lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <135cf5e8-4153-c0a9-70b8-f0a06713b550@huawei.com>
Date:   Tue, 29 Mar 2022 09:55:05 +0800
From:   Miaohe Lin <linmiaohe@...wei.com>
To:     Wei Yang <richard.weiyang@...il.com>
CC:     "Huang, Ying" <ying.huang@...el.com>, <akpm@...ux-foundation.org>,
        <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
        <mgorman@...hsingularity.net>
Subject: Re: [PATCH 2/2] mm/vmscan: make sure wakeup_kswapd with managed zone

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 <richard.weiyang@...il.com> 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 <richard.weiyang@...il.com>
>>>> ---
>>>>  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. :)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ