[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e2bebd6a-cc89-d6c2-8203-718b5c12ea4f@kernel.dk>
Date: Mon, 14 Jan 2019 21:28:33 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Ming Lei <ming.lei@...hat.com>
Cc: linux-block@...r.kernel.org, Clark Williams <williams@...hat.com>,
Guenter Roeck <linux@...ck-us.net>,
Steven Rostedt <rostedt@...dmis.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sbitmap: Protect swap_lock from hardirq
On 1/14/19 8:59 PM, Ming Lei wrote:
> The original report is actually one real deadlock:
>
> [ 106.132865] Possible interrupt unsafe locking scenario:
> [ 106.132865]
> [ 106.133659] CPU0 CPU1
> [ 106.134194] ---- ----
> [ 106.134733] lock(&(&sb->map[i].swap_lock)->rlock);
> [ 106.135318] local_irq_disable();
> [ 106.136014] lock(&sbq->ws[i].wait);
> [ 106.136747] lock(&(&hctx->dispatch_wait_lock)->rlock);
> [ 106.137742] <Interrupt>
> [ 106.138110] lock(&sbq->ws[i].wait);
>
> Because we may call blk_mq_get_driver_tag() directly from
> blk_mq_dispatch_rq_list() without holding any lock, then HARDIRQ may come
> and the above DEADLOCK is triggered.
>
> ab53dcfb3e7b ("sbitmap: Protect swap_lock from hardirq") tries to fix
> this issue by using 'spin_lock_bh', which isn't enough because we complete
> request from hardirq context direclty in case of multiqueue.
Thanks Ming, I'll queue this up for shipping this week.
--
Jens Axboe
Powered by blists - more mailing lists