summaryrefslogtreecommitdiffstats
path: root/mm/ioremap.c
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2021-05-22 01:59:38 +0200
committerVlastimil Babka <vbabka@suse.cz>2021-09-04 10:22:01 +0200
commitbd0e7491a931f5a2960555b10b9551464ff8cc8e (patch)
tree5a6be42db208b56198676c4b68655a48e508d695 /mm/ioremap.c
parentmm, slub: use migrate_disable() on PREEMPT_RT (diff)
downloadlinux-bd0e7491a931f5a2960555b10b9551464ff8cc8e.tar.xz
linux-bd0e7491a931f5a2960555b10b9551464ff8cc8e.zip
mm, slub: convert kmem_cpu_slab protection to local_lock
Embed local_lock into struct kmem_cpu_slab and use the irq-safe versions of local_lock instead of plain local_irq_save/restore. On !PREEMPT_RT that's equivalent, with better lockdep visibility. On PREEMPT_RT that means better preemption. However, the cost on PREEMPT_RT is the loss of lockless fast paths which only work with cpu freelist. Those are designed to detect and recover from being preempted by other conflicting operations (both fast or slow path), but the slow path operations assume they cannot be preempted by a fast path operation, which is guaranteed naturally with disabled irqs. With local locks on PREEMPT_RT, the fast paths now also need to take the local lock to avoid races. In the allocation fastpath slab_alloc_node() we can just defer to the slowpath __slab_alloc() which also works with cpu freelist, but under the local lock. In the free fastpath do_slab_free() we have to add a new local lock protected version of freeing to the cpu freelist, as the existing slowpath only works with the page freelist. Also update the comment about locking scheme in SLUB to reflect changes done by this series. [ Mike Galbraith <efault@gmx.de>: use local_lock() without irq in PREEMPT_RT scope; debugging of RT crashes resulting in put_cpu_partial() locking changes ] Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm/ioremap.c')
0 files changed, 0 insertions, 0 deletions