aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index a87549be8e53..c9aa37234e46 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1928,8 +1928,9 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request)
struct raid5_percpu *percpu;
unsigned long cpu;
- cpu = get_cpu();
+ cpu = get_cpu_light();
percpu = per_cpu_ptr(conf->percpu, cpu);
+ spin_lock(&percpu->lock);
if (test_bit(STRIPE_OP_BIOFILL, &ops_request)) {
ops_run_biofill(sh);
overlap_clear++;
@@ -1985,7 +1986,8 @@ static void raid_run_ops(struct stripe_head *sh, unsigned long ops_request)
if (test_and_clear_bit(R5_Overlap, &dev->flags))
wake_up(&sh->raid_conf->wait_for_overlap);
}
- put_cpu();
+ spin_unlock(&percpu->lock);
+ put_cpu_light();
}
static struct stripe_head *alloc_stripe(struct kmem_cache *sc, gfp_t gfp,
@@ -6438,6 +6440,7 @@ static int raid5_alloc_percpu(struct r5conf *conf)
__func__, cpu);
break;
}
+ spin_lock_init(&per_cpu_ptr(conf->percpu, cpu)->lock);
}
put_online_cpus();