From: Jens Axboe <axboe@fb.com>
To: Rabin Vincent <rabin@rab.in>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] null_blk: don't enable irqs when in irq
Date: Fri, 25 Dec 2015 21:03:12 -0700 [thread overview]
Message-ID: <567E1180.8070004@fb.com> (raw)
In-Reply-To: <1451053594-12188-1-git-send-email-rabin@rab.in>
On 12/25/2015 07:26 AM, Rabin Vincent wrote:
> When using irq_mode=NULL_IRQ_TIMER, blk_start_queue() is called from the
> hrtimer interrupt. null_request_fn() calls spin_unlock_irq() and this
> causes the following splat from lockdep since interrupts are being
> enabled while we're in an interrupt handler.
>
> When we're in null_request_fn() we can't know the status of the flags
> saved before blk_start_queue() was called, but we can use in_irq() to
> conditionally enable interrupts only if we're not in a hard interrupt in
> order to handle this case.
Using in_irq() to check for this is... nasty. You have two choices here.
Either you don't enable interrupts ever. That's safe from the
perspective of the driver, since we don't block in handling the command.
That means just unconditionally using spin_unlock() in the request_fn.
Or you punt queue running to process context, by manually clearing the
queue stopped flag and using blk_run_queue_async() instead.
--
Jens Axboe
next prev parent reply other threads:[~2015-12-26 4:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-25 14:26 [PATCH] null_blk: don't enable irqs when in irq Rabin Vincent
2015-12-26 4:03 ` Jens Axboe [this message]
2015-12-28 18:52 ` Jens Axboe
2015-12-28 19:07 ` Rabin Vincent
2015-12-28 19:11 ` Jens Axboe
2015-12-28 19:51 ` Rabin Vincent
2015-12-28 20:08 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=567E1180.8070004@fb.com \
--to=axboe@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rabin@rab.in \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox