Skip to content

Commit

Permalink
drivers/md/raid5: Use irqsave variant of atomic_dec_and_lock()
Browse files Browse the repository at this point in the history
The irqsave variant of atomic_dec_and_lock handles irqsave/restore when
taking/releasing the spin lock. With this variant the call of
local_irq_save is no longer required.

Cc: Shaohua Li <[email protected]>
Cc: [email protected]
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Anna-Maria Gleixner <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Shaohua Li <[email protected]>
  • Loading branch information
anna-marialx authored and shligit committed Jul 19, 2018
1 parent ebc7709 commit 685dbca
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,16 +409,15 @@ void raid5_release_stripe(struct stripe_head *sh)
md_wakeup_thread(conf->mddev->thread);
return;
slow_path:
local_irq_save(flags);
/* we are ok here if STRIPE_ON_RELEASE_LIST is set or not */
if (atomic_dec_and_lock(&sh->count, &conf->device_lock)) {
if (atomic_dec_and_lock_irqsave(&sh->count, &conf->device_lock, flags)) {
INIT_LIST_HEAD(&list);
hash = sh->hash_lock_index;
do_release_stripe(conf, sh, &list);
spin_unlock(&conf->device_lock);
release_inactive_stripe_list(conf, &list, hash);
local_irq_restore(flags);
}
local_irq_restore(flags);
}

static inline void remove_hash(struct stripe_head *sh)
Expand Down

0 comments on commit 685dbca

Please sign in to comment.