All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Vitaly Mayatskih <v.mayatskih@gmail.com>, linux-block@vger.kernel.org
Subject: Re: softirq->blk_mq_make_request deadlocks
Date: Tue, 22 May 2018 08:32:13 -0600	[thread overview]
Message-ID: <5bcc18e8-8d4c-2128-e119-20571e008cc0@kernel.dk> (raw)
In-Reply-To: <CAGF4SLg42Ni3gXAyVZOxZcaYVOBBS3qaTK9u=0NCAxPGwQLt-g@mail.gmail.com>

On 5/22/18 8:29 AM, Vitaly Mayatskih wrote:
> Hi,
> 
> I'm working on a new network block device and see occasional deadlocks
> when trying to submit_bio from softirq (network rcv handler). This may
> be a new use case for blk-mq, but I think context spinlock should be
> really taken with bh disabled. I *seem* can avoid the deadlock if bio
> has BIO_NOMERGE set, but I need to merge bios for better network
> utilization (no merge costs about 15% of bandwidth). Did I miss
> something, or the lock indeed needs no bh for that case (recursive
> ctx->lock in softirq)?

You can't call submit_bio() from irq/soft irq context, it will
potentially sleep for a new request. The various locks for blk-mq
have been carefully designed _not_ to need irq/bh disabling, but
that's really orthogonal to the previous comment which is your
main issue.

-- 
Jens Axboe

  reply	other threads:[~2018-05-22 14:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-22 14:29 softirq->blk_mq_make_request deadlocks Vitaly Mayatskih
2018-05-22 14:32 ` Jens Axboe [this message]
2018-05-22 14:36   ` Vitaly Mayatskih
2018-05-22 14:44     ` Jens Axboe
2018-05-22 14:50       ` Vitaly Mayatskih

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=5bcc18e8-8d4c-2128-e119-20571e008cc0@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=v.mayatskih@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.