linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Qi Zheng <zhengqi.arch@bytedance.com>
To: David Hildenbrand <david@redhat.com>
Cc: akpm@linux-foundation.org, rppt@kernel.org, vbabka@suse.cz,
	mhocko@suse.com, willy@infradead.org,
	mgorman@techsingularity.net, mingo@kernel.org,
	aneesh.kumar@linux.ibm.com, ying.huang@intel.com,
	hannes@cmpxchg.org, osalvador@suse.de,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v2 1/2] mm: page_alloc: skip memoryless nodes entirely
Date: Thu, 19 Oct 2023 16:21:44 +0800	[thread overview]
Message-ID: <76c6f4af-959c-1d6f-7df8-a2c1f9cd3adc@bytedance.com> (raw)
In-Reply-To: <cd210991-5038-4ad3-ac03-abb6761c67bd@redhat.com>

Hi David,

On 2023/10/19 16:07, David Hildenbrand wrote:
> On 19.10.23 09:36, Qi Zheng wrote:
>> In find_next_best_node(), We skipped the memoryless nodes
>> when building the zonelists of other normal nodes (N_NORMAL),
>> but did not skip the memoryless node itself when building
>> the zonelist. This will cause it to be traversed at runtime.
>>
>> For example, say we have node0 and node1, node0 is memoryless
>> node, then the fallback order of node0 and node1 as follows:
>>
>> [    0.153005] Fallback order for Node 0: 0 1
>> [    0.153564] Fallback order for Node 1: 1
>>
>> After this patch, we skip memoryless node0 entirely, then
>> the fallback order of node0 and node1 as follows:
>>
>> [    0.155236] Fallback order for Node 0: 1
>> [    0.155806] Fallback order for Node 1: 1
>>
>> So it becomes completely invisible, which will reduce runtime
>> overhead.
>>
>> And in this way, we will not try to allocate pages from memoryless
>> node0, then the panic mentioned in [1] will also be fixed. Even though
>> this problem has been solved by dropping the NODE_MIN_SIZE constrain
>> in x86 [2], it would be better to fix it in core MM as well.
>>
>> [1]. 
>> https://lore.kernel.org/all/20230212110305.93670-1-zhengqi.arch@bytedance.com/
>> [2]. https://lore.kernel.org/all/20231017062215.171670-1-rppt@kernel.org/
>>
>> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
>> ---
>>   mm/page_alloc.c | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index ee392a324802..e978272699d3 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -5052,8 +5052,11 @@ int find_next_best_node(int node, nodemask_t 
>> *used_node_mask)
>>       int min_val = INT_MAX;
>>       int best_node = NUMA_NO_NODE;
>> -    /* Use the local node if we haven't already */
>> -    if (!node_isset(node, *used_node_mask)) {
>> +    /*
>> +     * Use the local node if we haven't already. But for memoryless 
>> local
>> +     * node, we should skip it and fallback to other nodes.
>> +     */
>> +    if (!node_isset(node, *used_node_mask) && node_state(node, 
>> N_MEMORY)) {
>>           node_set(node, *used_node_mask);
>>           return node;
>>       }
> 
> Makes sense to me; I suspect that online_pages() will just to the right 
> thing and call build_all_zonelists() to fix it up.

Yes, the find_next_best_node() will be called by build_all_zonelists().

> 
> Acked-by: David Hildenbrand <david@redhat.com>

Thanks.

> 


  reply	other threads:[~2023-10-19  8:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19  7:36 [PATCH v2 0/2] handle memoryless nodes more appropriately Qi Zheng
2023-10-19  7:36 ` [PATCH v2 1/2] mm: page_alloc: skip memoryless nodes entirely Qi Zheng
2023-10-19  8:07   ` David Hildenbrand
2023-10-19  8:21     ` Qi Zheng [this message]
2023-10-19  7:36 ` [PATCH v2 2/2] mm: memory_hotplug: drop memoryless node from fallback lists Qi Zheng
2023-10-19  8:11   ` David Hildenbrand
2023-10-19  8:22     ` Qi Zheng
2023-10-19  7:56 ` [PATCH v2 0/2] handle memoryless nodes more appropriately David Hildenbrand
2023-10-19  8:17   ` Qi Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76c6f4af-959c-1d6f-7df8-a2c1f9cd3adc@bytedance.com \
    --to=zhengqi.arch@bytedance.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=mingo@kernel.org \
    --cc=osalvador@suse.de \
    --cc=rppt@kernel.org \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox