]> git.baikalelectronics.ru Git - kernel.git/commit
mm, slub: call deactivate_slab() without disabling irqs
authorVlastimil Babka <vbabka@suse.cz>
Wed, 12 May 2021 12:04:43 +0000 (14:04 +0200)
committerVlastimil Babka <vbabka@suse.cz>
Fri, 3 Sep 2021 23:12:22 +0000 (01:12 +0200)
commit90379f8fc9bbf5567c77e86108683ea9e5e498f7
tree038be3757ff36054c967ee3f023717d8af98af05
parent2e59d55681724553f3f8dfef53eec8071d308578
mm, slub: call deactivate_slab() without disabling irqs

The function is now safe to be called with irqs enabled, so move the calls
outside of irq disabled sections.

When called from ___slab_alloc() -> flush_slab() we have irqs disabled, so to
reenable them before deactivate_slab() we need to open-code flush_slab() in
___slab_alloc() and reenable irqs after modifying the kmem_cache_cpu fields.
But that means a IRQ handler meanwhile might have assigned a new page to
kmem_cache_cpu.page so we have to retry the whole check.

The remaining callers of flush_slab() are the IPI handler which has disabled
irqs anyway, and slub_cpu_dead() which will be dealt with in the following
patch.

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