.. | .. |
---|
2069 | 2069 | struct raid5_percpu *percpu; |
---|
2070 | 2070 | unsigned long cpu; |
---|
2071 | 2071 | |
---|
2072 | | - cpu = get_cpu(); |
---|
| 2072 | + cpu = get_cpu_light(); |
---|
2073 | 2073 | percpu = per_cpu_ptr(conf->percpu, cpu); |
---|
| 2074 | + spin_lock(&percpu->lock); |
---|
2074 | 2075 | if (test_bit(STRIPE_OP_BIOFILL, &ops_request)) { |
---|
2075 | 2076 | ops_run_biofill(sh); |
---|
2076 | 2077 | overlap_clear++; |
---|
.. | .. |
---|
2129 | 2130 | if (test_and_clear_bit(R5_Overlap, &dev->flags)) |
---|
2130 | 2131 | wake_up(&sh->raid_conf->wait_for_overlap); |
---|
2131 | 2132 | } |
---|
2132 | | - put_cpu(); |
---|
| 2133 | + spin_unlock(&percpu->lock); |
---|
| 2134 | + put_cpu_light(); |
---|
2133 | 2135 | } |
---|
2134 | 2136 | |
---|
2135 | 2137 | static void free_stripe(struct kmem_cache *sc, struct stripe_head *sh) |
---|
.. | .. |
---|
6816 | 6818 | __func__, cpu); |
---|
6817 | 6819 | return -ENOMEM; |
---|
6818 | 6820 | } |
---|
| 6821 | + spin_lock_init(&per_cpu_ptr(conf->percpu, cpu)->lock); |
---|
6819 | 6822 | return 0; |
---|
6820 | 6823 | } |
---|
6821 | 6824 | |
---|
.. | .. |
---|
6826 | 6829 | conf->percpu = alloc_percpu(struct raid5_percpu); |
---|
6827 | 6830 | if (!conf->percpu) |
---|
6828 | 6831 | return -ENOMEM; |
---|
6829 | | - |
---|
6830 | 6832 | err = cpuhp_state_add_instance(CPUHP_MD_RAID5_PREPARE, &conf->node); |
---|
6831 | 6833 | if (!err) { |
---|
6832 | 6834 | conf->scribble_disks = max(conf->raid_disks, |
---|