Commit 060288a7 authored by Anna-Maria Gleixner's avatar Anna-Maria Gleixner Committed by Linus Torvalds

bdi: use irqsave variant of refcount_dec_and_lock()

The irqsave variant of refcount_dec_and_lock handles irqsave/restore when
taking/releasing the spin lock.  With this variant the call of
local_irq_save/restore is no longer required.

[bigeasy@linutronix.de: s@atomic_dec_and_lock@refcount_dec_and_lock@g]
Link: http://lkml.kernel.org/r/20180703200141.28415-5-bigeasy@linutronix.deSigned-off-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e58dd0de
...@@ -473,11 +473,8 @@ void wb_congested_put(struct bdi_writeback_congested *congested) ...@@ -473,11 +473,8 @@ void wb_congested_put(struct bdi_writeback_congested *congested)
{ {
unsigned long flags; unsigned long flags;
local_irq_save(flags); if (!refcount_dec_and_lock_irqsave(&congested->refcnt, &cgwb_lock, &flags))
if (!refcount_dec_and_lock(&congested->refcnt, &cgwb_lock)) {
local_irq_restore(flags);
return; return;
}
/* bdi might already have been destroyed leaving @congested unlinked */ /* bdi might already have been destroyed leaving @congested unlinked */
if (congested->__bdi) { if (congested->__bdi) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment