From: Vlastimil Babka <vbabka@suse.cz>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Oscar Salvador <osalvador@suse.de>,
David Hildenbrand <david@redhat.com>
Subject: Re: [PATCH 1/2] mm/page_alloc: add same penalty is enough to get round-robin order
Date: Thu, 7 Apr 2022 11:53:19 +0200 [thread overview]
Message-ID: <78a1ecd4-95a2-bd72-8be7-433db21364bd@suse.cz> (raw)
In-Reply-To: <20220406234754.4vpi5sjztcsusqiq@master>
On 4/7/22 01:47, Wei Yang wrote:
> On Tue, Apr 05, 2022 at 07:11:12PM +0200, Vlastimil Babka wrote:
>>On 1/23/22 02:35, Wei Yang wrote:
>>> To make node order in round-robin in the same distance group, we add a
>>> penalty to the first node we got in each round.
>>>
>>> To get a round-robin order in the same distance group, we don't need to
>>> decrease the penalty since:
>>>
>>> * find_next_best_node() always iterates node in the same order
>>> * distance matters more then penalty in find_next_best_node()
>>> * in nodes with the same distance, the first one would be picked up
>>>
>>> So it is fine to increase same penalty when we get the first node in the
>>> same distance group.
>>
>>With that logic I'm not even sure if we need nr_online_nodes as penalty or
>>it could be just 1. Would you know?
>
> Yes, it has the same effect.
Good.
> [ 0.031849] Fallback order for Node 0: 0 1 2 3 4 5 6 7
> [ 0.031854] Fallback order for Node 1: 1 2 3 0 5 6 7 4
> [ 0.031857] Fallback order for Node 2: 2 3 0 1 6 7 4 5
> [ 0.031860] Fallback order for Node 3: 3 0 1 2 7 4 5 6
> [ 0.031864] Fallback order for Node 4: 4 5 6 7 0 1 2 3
> [ 0.031867] Fallback order for Node 5: 5 6 7 4 1 2 3 0
> [ 0.031870] Fallback order for Node 6: 6 7 4 5 2 3 0 1
> [ 0.031873] Fallback order for Node 7: 7 4 5 6 3 0 1 2
>
> Do you prefer to set it to 1?
Yeah I think it's worth simplyfing as much as feasible, so the code is more
obvious. I think we can also then remove the MAX_NODE_LOAD #define and usage.
Also please Cc at least Oscar and David (added to Cc now) on v2 as they have
been active in memory hotplug area recently.
Thanks,
Vlastimil
prev parent reply other threads:[~2022-04-07 9:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-23 1:35 Wei Yang
2022-01-23 1:35 ` [PATCH 2/2] mm/page_alloc: add penalty to local_node Wei Yang
2022-03-21 21:17 ` [PATCH 1/2] mm/page_alloc: add same penalty is enough to get round-robin order Andrew Morton
2022-03-26 15:48 ` Wei Yang
2022-04-05 17:11 ` Vlastimil Babka
2022-04-06 23:47 ` Wei Yang
2022-04-07 9:53 ` Vlastimil Babka [this message]
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=78a1ecd4-95a2-bd72-8be7-433db21364bd@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=osalvador@suse.de \
--cc=richard.weiyang@gmail.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