Linux block layer
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: David Howells <dhowells@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	ming.lei@redhat.com
Subject: Re: [PATCH] lib/iov_iter.c: extract virt-contiguous pages in iov_iter_extract_bvec_pages
Date: Sun, 6 Oct 2024 10:55:11 +0800	[thread overview]
Message-ID: <ZwH8D-Hx4G7XvOUC@fedora> (raw)
In-Reply-To: <3855842.1728061012@warthog.procyon.org.uk>

On Fri, Oct 04, 2024 at 05:56:52PM +0100, David Howells wrote:
> Ming Lei <ming.lei@redhat.com> wrote:
> 
> > All iov_iter_bvec() users only want to extract virt-contiguous pages from
> > iov_iter_extract_pages() instead physical-contiguous pages.
> 
> What do you mean by "virt-contiguous"?  Virtual according to what mapping?

The term is from comment iov_iter_extract_kvec_pages(), seems it is
invented by you, :-)

Actually iov_iter_extract_pages() requires that there isn't gap in the
extracted pages, so 'offset' only exists in the 1st page, then these
pages can be mapped to one virtual(contiguous) address.

> 
> The reason for physical contiguity is that you can pass a set of physical
> contiguous pages as a single DMA descriptor.  Therefore, at some point, you
> might end up screwing up skb_splice_from_iter().  Currently, that's limited to
> a PAGE_SIZE per fragment, but hopefully that will be fixed at some point.

If any user wants to extract physical pages, new interface can be added for
returning single page instead of page array, cause it is physically contiguous.

Other kind of iterators(UBUF, KVEC, ...) do return non physically-contiguous
pages.

The point is that one bvec often point to one page except for huge page
case, so iov_iter_extract_pages() just returns single page each time
no matter how big maxpages & maxsize is passed in.

It is actually one regression:

Fixes: a7e689dd1c06 ("block: Convert bio_iov_iter_get_pages to use iov_iter_extract_pages")


Thanks,
Ming


      reply	other threads:[~2024-10-06  2:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 15:30 [PATCH] lib/iov_iter.c: extract virt-contiguous pages in iov_iter_extract_bvec_pages Ming Lei
2024-10-04 16:56 ` David Howells
2024-10-06  2:55   ` Ming Lei [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=ZwH8D-Hx4G7XvOUC@fedora \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=dhowells@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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