Linux CXL
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Naman Jain" <namjain@linux.microsoft.com>,
	hch@lst.de, david@kernel.org, axboe@kernel.dk,
	akpm@linux-foundation.org, viro@zeniv.linux.org.uk
Cc: osalvador@suse.de, logang@deltatee.com, leon@kernel.org,
	kbusch@kernel.org, ssengar@linux.microsoft.com,
	linux-mm@kvack.org, linux-cxl@vger.kernel.org
Subject: Re: [PATCH v2] iov_iter: Allow DMA-compatible device pages in bvec extraction
Date: Fri, 04 Dec 2026 08:43:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-249422@kernel.org> (raw)
In-Reply-To: <20261203084315.3776182-1-namjain@linux.microsoft.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] iov_iter: inaccurate Fixes trailer cites 38446014648c instead of
  12da89e8844a
--

commit 41e8c0f2dd22c3f923973ea161eb22f302ba5525
Author: Naman Jain <namjain@linux.microsoft.com>

> iov_iter: Allow DMA-compatible device pages in bvec extraction
>
> Commit 38446014648c ("block: don't merge different kinds of P2P transfers
> in a single bio") made bio_add_page() reject pages from different
> dev_pagemaps. This was needed for PCI P2PDMA, but also rejected pages
> with compatible DMA mapping requirements.
>
> Commit 41c665aae2b5 ("block: relax pgmap check in bio_add_page for
> compatible zone device pages") allows these pages in separate bvecs.
> Commit 13920e4b7b784 ("block: add pgmap check to biovec_phys_mergeable")
> prevents physically contiguous bvecs from different pgmaps from being
> merged into one segment.
>
> But iov_iter_extract_bvecs() still rejects pages from different pgmaps
> without checking their DMA compatibility. Direct I/O uses this helper,
> so a non-atomic request submitted as a single bio transfers only the
> data before the pgmap boundary and returns fewer bytes than requested.
>
> Fix this by moving zone_device_pages_compatible() from blk.h to
> memremap.h and using it in iov_iter_extract_bvecs(). Rename the helper to
> zone_device_pages_dma_compatible() to make its purpose clear.
>
> Fixes: 38446014648c ("block: don't merge different kinds of P2P transfers in a single bio")
> Cc: stable@vger.kernel.org
> Signed-off-by: Naman Jain <namjain@linux.microsoft.com>

[Severity: Low]
Should the Fixes tag cite 12da89e8844a ("block: open code bio_add_page
and fix handling of mismatching P2P ranges") instead?

Commit 38446014648c ("block: don't merge different kinds of P2P transfers
in a single bio") only touched bio_add_page() and
bio_integrity_add_page(), which 41c665aae2b5 ("block: relax pgmap check
in bio_add_page for compatible zone device pages") already fixed.

The separate check in the page-extraction loop came from 12da89e8844a
("block: open code bio_add_page and fix handling of mismatching P2P
ranges") and was moved to iov_iter_extract_bvecs() by 91b73c458182
("iov_iter: extract a iov_iter_extract_bvecs helper from bio code").

With Cc: stable@vger.kernel.org, the current Fixes tag targets older
stable trees that do not have iov_iter_extract_bvecs() and already carry
the bio_add_page() fix.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203084315.3776182-1-namjain@linux.microsoft.com?part=1

      parent reply	other threads:[~2026-12-04  8:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03  8:43 [PATCH v2] iov_iter: Allow DMA-compatible device pages in bvec extraction Naman Jain
2026-12-03  9:53 ` Christoph Hellwig
2026-12-03 10:02 ` David Hildenbrand (Arm)
2026-12-03 10:03   ` Christoph Hellwig
2026-12-03 10:13     ` David Hildenbrand (Arm)
2026-12-04  8:43 ` sashiko-bot [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=sashiko-outbox-249422@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=david@kernel.org \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=logang@deltatee.com \
    --cc=namjain@linux.microsoft.com \
    --cc=osalvador@suse.de \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=ssengar@linux.microsoft.com \
    --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