public inbox for [email protected]
 help / color / mirror / Atom feed
From: Christoph Hellwig <[email protected]>
To: Pavel Begunkov <[email protected]>
Cc: Christian Brauner <[email protected]>,
	[email protected], Dave Chinner <[email protected]>,
	[email protected], "Darrick J . Wong" <[email protected]>,
	[email protected], wu lei <[email protected]>
Subject: Re: [PATCH v2 1/1] iomap: propagate nowait to block layer
Date: Tue, 4 Mar 2025 08:07:03 -0800	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <f287a7882a4c4576e90e55ecc5ab8bf634579afd.1741090631.git.asml.silence@gmail.com>

On Tue, Mar 04, 2025 at 12:18:07PM +0000, Pavel Begunkov wrote:
>  	    ((dio->flags & IOMAP_DIO_NEED_SYNC) && !use_fua) ||
> -	    ((dio->flags & IOMAP_DIO_WRITE) && pos >= i_size_read(inode)))
> +	    ((dio->flags & IOMAP_DIO_WRITE) && pos >= i_size_read(inode))) {
>  		dio->flags &= ~IOMAP_DIO_CALLER_COMP;
>  
> +		if (!is_sync_kiocb(dio->iocb) &&
> +		    (dio->iocb->ki_flags & IOCB_NOWAIT))
> +			return -EAGAIN;

Black magic without comments explaining it.

> +	if (!is_sync_kiocb(dio->iocb) && (dio->iocb->ki_flags & IOCB_NOWAIT)) {
> +		/*
> +		 * This is nonblocking IO, and we might need to allocate
> +		 * multiple bios. In this case, as we cannot guarantee that
> +		 * one of the sub bios will not fail getting issued FOR NOWAIT
> +		 * and as error results are coalesced across all of them, ask
> +		 * for a retry of this from blocking context.
> +		 */
> +		if (bio_iov_vecs_to_alloc(dio->submit.iter, BIO_MAX_VECS + 1) >
> +					  BIO_MAX_VECS)

This is not very accurate in times of multi-page bvecs and large order
folios all over.

I think you really need to byte the bullet and support for early returns
from the non-blocking bio submission path.


  reply	other threads:[~2025-03-04 16:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 12:18 [PATCH v2 1/1] iomap: propagate nowait to block layer Pavel Begunkov
2025-03-04 16:07 ` Christoph Hellwig [this message]
2025-03-04 16:41   ` Pavel Begunkov
2025-03-04 16:59     ` Christoph Hellwig
2025-03-04 17:36       ` Jens Axboe
2025-03-04 23:26         ` Christoph Hellwig
2025-03-04 23:43           ` Jens Axboe
2025-03-04 23:49             ` Christoph Hellwig
2025-03-05  0:14               ` Pavel Begunkov
2025-03-05  0:18                 ` Pavel Begunkov
2025-03-04 17:54       ` Pavel Begunkov
2025-03-04 23:28         ` Christoph Hellwig
2025-03-04 19:22     ` Darrick J. Wong
2025-03-04 20:35       ` Pavel Begunkov
2025-03-05  0:01         ` Christoph Hellwig
2025-03-05  0:45           ` Pavel Begunkov
2025-03-05  1:34             ` Christoph Hellwig
2025-03-04 21:11 ` Dave Chinner
2025-03-04 22:47   ` Pavel Begunkov
2025-03-04 23:40     ` Christoph Hellwig
2025-03-05  1:19     ` Dave Chinner
2025-03-05 14:10       ` Christoph Hellwig

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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