mm/slub: refactor calculate_order() and calc_slab_order()
authorVlastimil Babka <vbabka@suse.cz>
Fri, 8 Sep 2023 10:18:09 +0000 (12:18 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Mon, 2 Oct 2023 09:55:47 +0000 (11:55 +0200)
commit90f055df112162fd9e093c16be1c21f38c35b907
tree323590ff68c2424b4c0ec64ca6f49c64fa7f410f
parent5886fc82b6e3166dd1ba876809888fc39028d626
mm/slub: refactor calculate_order() and calc_slab_order()

After the previous cleanups, we can now move some code from
calc_slab_order() to calculate_order() so it's executed just once, and
do some more cleanups.

- move the min_order and MAX_OBJS_PER_PAGE evaluation to
  calculate_order().

- change calc_slab_order() parameter min_objects to min_order

Also make MAX_OBJS_PER_PAGE check more robust by considering also
min_objects in addition to slub_min_order. Otherwise this is not a
functional change.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Feng Tang <feng.tang@intel.com>
Reviewed-and-tested-by: Jay Patel <jaypatel@linux.ibm.com>
mm/slub.c