mm/slub: Convert alloc_slab_page() to return a struct slab
authorVlastimil Babka <vbabka@suse.cz>
Tue, 26 Oct 2021 14:35:02 +0000 (16:35 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Thu, 6 Jan 2022 11:26:01 +0000 (12:26 +0100)
commit45387b8c14143623dfe905b5260836f9d62e1371
tree3be8a7b7ab46f64f54abfdef833488defa4f8537
parentfb012e278dbfc80194bf34c7ade4f261bbc747ea
mm/slub: Convert alloc_slab_page() to return a struct slab

Preparatory, callers convert back to struct page for now.

Also move setting page flags to alloc_slab_page() where we still operate
on a struct page. This means the page->slab_cache pointer is now set
later than the PageSlab flag, which could theoretically confuse some pfn
walker assuming PageSlab means there would be a valid cache pointer. But
as the code had no barriers and used __set_bit() anyway, it could have
happened already, so there shouldn't be such a walker.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Roman Gushchin <guro@fb.com>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
mm/slub.c