mm/page_alloc: adding same penalty is enough to get round-robin order
authorWei Yang <richard.weiyang@gmail.com>
Wed, 16 Feb 2022 04:31:16 +0000 (15:31 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 16 Feb 2022 04:31:16 +0000 (15:31 +1100)
commit807fb5116c0eabd54d93095b158b73994ec11e68
treec7df1ddb7934caa3b54745aa3ae9c7eb19405416
parent4833404b8ae71681ac6b540e619b3fefde36bf0b
mm/page_alloc: adding same penalty is enough to get round-robin order

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.

Link: https://lkml.kernel.org/r/20220123013537.20491-1-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Krupa Ramakrishnan <krupa.ramakrishnan@amd.com>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/page_alloc.c