Skip to content

Commit 685dbca

Browse files
anna-marialxshligit
authored andcommitted
drivers/md/raid5: Use irqsave variant of atomic_dec_and_lock()
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 <shli@kernel.org> Cc: linux-raid@vger.kernel.org Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Shaohua Li <shli@fb.com>
1 parent ebc7709 commit 685dbca

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎drivers/md/raid5.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,16 +409,15 @@ void raid5_release_stripe(struct stripe_head *sh)
409409
md_wakeup_thread(conf->mddev->thread);
410410
return;
411411
slow_path:
412-
local_irq_save(flags);
413412
/* we are ok here if STRIPE_ON_RELEASE_LIST is set or not */
414-
if (atomic_dec_and_lock(&sh->count, &conf->device_lock)) {
413+
if (atomic_dec_and_lock_irqsave(&sh->count, &conf->device_lock, flags)) {
415414
INIT_LIST_HEAD(&list);
416415
hash = sh->hash_lock_index;
417416
do_release_stripe(conf, sh, &list);
418417
spin_unlock(&conf->device_lock);
419418
release_inactive_stripe_list(conf, &list, hash);
419+
local_irq_restore(flags);
420420
}
421-
local_irq_restore(flags);
422421
}
423422

424423
static inline void remove_hash(struct stripe_head *sh)

0 commit comments

Comments
 (0)