mm, slub: restructure new page checks in ___slab_alloc()
authorVlastimil Babka <vbabka@suse.cz>
Tue, 11 May 2021 16:25:09 +0000 (18:25 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Fri, 3 Sep 2021 23:12:20 +0000 (01:12 +0200)
commit1572df7cbcb48936c880f2d2de524f8e47ab65d4
treec8b047bc9e508d272501e549e1f9a6e4b8647a46
parent75c8ff281d7a6faa650bb9b32052f3ee1b5f8e83
mm, slub: restructure new page checks in ___slab_alloc()

When we allocate slab object from a newly acquired page (from node's partial
list or page allocator), we usually also retain the page as a new percpu slab.
There are two exceptions - when pfmemalloc status of the page doesn't match our
gfp flags, or when the cache has debugging enabled.

The current code for these decisions is not easy to follow, so restructure it
and add comments. The new structure will also help with the following changes.
No functional change.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
mm/slub.c