]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/page_alloc: adding same penalty is enough to get round-robin order
authorWei Yang <richard.weiyang@gmail.com>
Thu, 14 Apr 2022 06:07:09 +0000 (23:07 -0700)
committerakpm <akpm@linux-foundation.org>
Thu, 14 Apr 2022 06:07:09 +0000 (23:07 -0700)
commit538a12dfbf6f3e94612ed13e3696583a06570735
treeba68532a88d3cadf3f109df05a8c34fe6c8a3e87
parentb24ea048b4c290959996309b62041e9f33569afd
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.  Since we just increase a constance of 1 to node
penalty, it is not necessary to multiply MAX_NODE_LOAD for preference.

Link: https://lkml.kernel.org/r/20220123013537.20491-1-richard.weiyang@gmail.com
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Oscar Salvador <osalvador@suse.de>
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>
mm/page_alloc.c