All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Christoph Hellwig <hch@lst.de>, Bart Van Assche <bvanassche@acm.org>
Cc: Damien Le Moal <dlemoal@kernel.org>,
	Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	linux-block@vger.kernel.org, dm-devel@lists.linux.dev
Subject: Re: add a flag to allow underordered zoned writes
Date: Wed, 19 Nov 2025 10:00:51 -0700	[thread overview]
Message-ID: <7cf8b8de-0ed9-4182-aa84-de29f16f37f0@kernel.dk> (raw)
In-Reply-To: <20251119075800.GA23083@lst.de>

On 11/19/25 12:58 AM, Christoph Hellwig wrote:
> On Tue, Nov 18, 2025 at 10:10:33PM -0800, Bart Van Assche wrote:
>> Is the following deadlock inherent to this approach?
>> - Several bios are present on zwplug->bio_list and these bios cannot be
>>   submitted because their starting offset is past the write pointer.
>> - No new bios can be allocated because all memory is in use.
>> - A deadlock occurs because none of the queued bios can be submitted
>>   and no new bio can be allocated.
> 
> This can if the number of in-flight bios is larger than bio mempool
> reserve.  Which is real, but we also have this in various other
> submitters that hold bios to submit in a list.  This suggests it is
> mostly theoretical, but I'd still love to address it for all these
> cases.

The default bio pool size is 2 entries, which is perfectly fine for the
"normal" alloc-and-submit cases. But yes if you're doing a bunch of
allocations before submitting, then it could certainly deadlock if the
normal allocation fails and we end up sleeping in the mempool waiting
for previous unsubmitted IO to finish.

It's certainly a bit tricky to handle... But definitely something we
should take a stab at, as it basically voids the forward progress
guarantee and is surely something that will cause production workload
deadlocks if REQ_ZWPLUG_UNORDERED is used.

-- 
Jens Axboe

      reply	other threads:[~2025-11-19 17:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18  7:03 add a flag to allow underordered zoned writes Christoph Hellwig
2025-11-18  7:03 ` [PATCH 1/3] block: add a bio_list_add_sorted helper Christoph Hellwig
2025-11-19  3:09   ` Damien Le Moal
2025-11-18  7:03 ` [PATCH 2/3] block: add a REQ_ZWPLUG_UNORDERED flag Christoph Hellwig
2025-11-19  3:17   ` Damien Le Moal
2025-11-18  7:03 ` [PATCH 3/3] dm-kcopyd: use REQ_ZWPLUG_UNORDERED Christoph Hellwig
2025-11-19  3:18   ` Damien Le Moal
2025-11-19  6:10 ` add a flag to allow underordered zoned writes Bart Van Assche
2025-11-19  7:58   ` Christoph Hellwig
2025-11-19 17:00     ` Jens Axboe [this message]

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=7cf8b8de-0ed9-4182-aa84-de29f16f37f0@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=dlemoal@kernel.org \
    --cc=dm-devel@lists.linux.dev \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    /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.