mm, slub: move reset of c->page and freelist out of deactivate_slab()
authorVlastimil Babka <vbabka@suse.cz>
Wed, 12 May 2021 11:53:34 +0000 (13:53 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Fri, 3 Sep 2021 23:12:21 +0000 (01:12 +0200)
commita019d20162586ae5b14bf26c94f1943b1d24a832
tree0774c208ec60a6d622a0a06dab30e53d4cd3fe25
parent4b1f449dedd2ff1eede4ced08a503e13c8d668ce
mm, slub: move reset of c->page and freelist out of deactivate_slab()

deactivate_slab() removes the cpu slab by merging the cpu freelist with slab's
freelist and putting the slab on the proper node's list. It also sets the
respective kmem_cache_cpu pointers to NULL.

By extracting the kmem_cache_cpu operations from the function, we can make it
not dependent on disabled irqs.

Also if we return a single free pointer from ___slab_alloc, we no longer have
to assign kmem_cache_cpu.page before deactivation or care if somebody preempted
us and assigned a different page to our kmem_cache_cpu in the process.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slub.c