linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] percpu_counter: fix irq restore in __percpu_counter_add
@ 2013-10-03 10:15 Christoph Hellwig
  2013-10-03 16:21 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2013-10-03 10:15 UTC (permalink / raw)
  To: Shaohua Li, Jens Axboe; +Cc: linux-kernel

The current version of "percpu_counter: make APIs irq safe" in the blk-mq
tree doesn't properly restore irqs, thus causing the boot of the blk-multique
tree to fail with various irqs_disabled() BUGs and related issues.
     
Signed-off-by: Christoph Hellwig <hch@lst.de>

diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c
index 1ae43a7..7473ee3 100644
--- a/lib/percpu_counter.c
+++ b/lib/percpu_counter.c
@@ -82,7 +82,7 @@ void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
 		unsigned long flags;
 		raw_spin_lock_irqsave(&fbc->lock, flags);
 		fbc->count += count;
-		raw_spin_unlock(&fbc->lock);
+		raw_spin_unlock_irqrestore(&fbc->lock, flags);
 		__this_cpu_write(*fbc->counters, 0);
 	} else {
 		__this_cpu_write(*fbc->counters, count);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] percpu_counter: fix irq restore in __percpu_counter_add
  2013-10-03 10:15 [PATCH] percpu_counter: fix irq restore in __percpu_counter_add Christoph Hellwig
@ 2013-10-03 16:21 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2013-10-03 16:21 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Shaohua Li, linux-kernel

On 10/03/2013 04:15 AM, Christoph Hellwig wrote:
> The current version of "percpu_counter: make APIs irq safe" in the blk-mq
> tree doesn't properly restore irqs, thus causing the boot of the blk-multique
> tree to fail with various irqs_disabled() BUGs and related issues.
>      
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Thanks Christoph, merge issue I'm assuming. I'll fix it up.


-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-03 16:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-03 10:15 [PATCH] percpu_counter: fix irq restore in __percpu_counter_add Christoph Hellwig
2013-10-03 16:21 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).