diff options
author | Davidlohr Bueso <dave@stgolabs.net> | 2021-11-16 04:23:17 +0300 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2022-01-06 19:37:02 +0300 |
commit | 770b1d216d7371c94c88713824da4be4bc39a4e0 (patch) | |
tree | cba5d938c9e40a529a153b421b905dea87099b82 /drivers/md/raid5.h | |
parent | 050f461e28c5d13f327353d660ffad2603ce7ac1 (diff) | |
download | linux-770b1d216d7371c94c88713824da4be4bc39a4e0.tar.xz |
md/raid5: play nice with PREEMPT_RT
raid_run_ops() relies on the implicitly disabled preemption for
its percpu ops, although this is really about CPU locality. This
breaks RT semantics as it can take regular (and thus sleeping)
spinlocks, such as stripe_lock.
Add a local_lock such that non-RT does not change and continues
to be just map to preempt_disable/enable, but makes RT happy as
the region will use a per-CPU spinlock and thus be preemptible
and still guarantee CPU locality.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Song Liu <songliubraving@fb.com>
Diffstat (limited to 'drivers/md/raid5.h')
-rw-r--r-- | drivers/md/raid5.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h index 5c05acf20e1f..9e8486a9e445 100644 --- a/drivers/md/raid5.h +++ b/drivers/md/raid5.h @@ -4,6 +4,7 @@ #include <linux/raid/xor.h> #include <linux/dmaengine.h> +#include <linux/local_lock.h> /* * @@ -640,7 +641,8 @@ struct r5conf { * lists and performing address * conversions */ - int scribble_obj_size; + int scribble_obj_size; + local_lock_t lock; } __percpu *percpu; int scribble_disks; int scribble_sectors; |