[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4687e93d-9245-300e-6193-d5428a76c9b8@huawei.com>
Date: Tue, 23 Aug 2022 21:12:03 +0800
From: Liu Shixin <liushixin2@...wei.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
huang ying <huang.ying.caritas@...il.com>,
Aaron Lu <aaron.lu@...el.com>,
Dave Hansen <dave.hansen@...el.com>,
"Michal Hocko" <mhocko@...e.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Vlastimil Babka <vbabka@...e.cz>,
Kemi Wang <kemi.wang@...el.com>,
"Kefeng Wang" <wangkefeng.wang@...wei.com>,
<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>
Subject: Re: [PATCH -next v2] mm, proc: collect percpu free pages into the
free pages
On 2022/8/23 5:13, Andrew Morton wrote:
> On Mon, 22 Aug 2022 14:12:07 -0700 Andrew Morton <akpm@...ux-foundation.org> wrote:
>
>> Prevention of races against zone/node hotplug?
> I meant "cpu/node", of course.
> .
Thanks for your advice, but I didn't quite understand what you meant.
Do you mean that I should use cpus_read_lock() to protect cpu hotplug just like this?
+ cpus_read_lock();
for_each_online_cpu(cpu)
sum += per_cpu_ptr(zone->per_cpu_pageset, cpu)->count;
+ cpus_read_unlock();
I see there is some areas were not protected by the cpus_{read/write}_lock, so I was confused
as to whether I should add it.
I want to replace for_each_zone with for_each_populated_zone, what else should I do to protect
node hotplug.
Thanks.
Powered by blists - more mailing lists