Re: [PATCH -V8 02/10] mm/numa: automatically generate node migration order
From: Dave Hansen
Date: Mon Jun 21 2021 - 15:53:13 EST
On 6/19/21 1:18 AM, Huang, Ying wrote:
>>> int next_demotion_node(int node)
>>> {
>>> - return node_demotion[node];
>>> + /*
>>> + * node_demotion[] is updated without excluding
>>> + * this function from running. READ_ONCE() avoids
>>> + * reading multiple, inconsistent 'node' values
>>> + * during an update.
>>> + */
>>> + return READ_ONCE(node_demotion[node]);
>>> }
>> Is it necessary to have two separate patches to add node_demotion and
>> next_demotion_node() then modify it immediately? Maybe merge Patch 1 into 2?
>>
>> Hmm, I just checked Patch 3 and it changes node_demotion again and uses RCU.
>> I guess it might be much simpler to just introduce node_demotion with RCU
>> in this patch and Patch 3 only takes care of hotplug events.
> Hi, Dave,
>
> What do you think about this?
>
Squashing them seems like a good idea to me.