From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796373818; b=XoJOKldeLbl2uwchLYfix/U3YdkROEeKgWYjf15Udaxj45248C1Wg54Balsj2EA5BBLy efaNJXii6jFPldGR7kSbMkSWWpT/uDrAdYQZN9qP0rhREv8sYmSoC9XHgm9cJs86NnvQ0 nFkm2Whknd3X+Wpg2R6qBJ26b/Q3lqSX/BSkdBvdf5TU4RTpKjtMwdqhRbbdWgVe2OA9+ Rf4d1ZF5winFIJ9+HvXddMW5VYFRhT975bSnUjPqELaBz5QXqZ+3jny4Kbff7RFTTFxTJ knOi7kScUJrneTAXAQ2mcIy2on2upoqWJ0VMIy/zDK8Ok1czTTgH472X8PGijurmqYg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796373818; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=+8bNnHBOWcWE0+qNHpXZEWVzsCfbPxSIoBBdEEBeFW4=; b=ZHWU1gjs0QXkq5f6Tn+YLwoDr9IFRxuwzhyycqcMm/jJvDjDFxUY0shJwgDjAAt3+tDa vel6QcRM77YftLFJTKm3XjXv3TrZmBwIdg7dGaa6ZD6A2eRwe203ZC+GmJhaKhWsqEzHp sNMSNA21sD3fgChiYeEYQXQoBX8cz2tpNYVSXfTsjI/gzoJwttYcnmHcWrGBgJoQ7WPcj zKw0ok5zcr+HJ2is5dYkmSxgOky1Q+2Z9CRr36CWaB959Bhf/Yqqqma7HbbGxP5ML6nx6 pEBahkx+9NakC3RHbDbwU/7de1d2e0qgL9KhMBqVonVJIA+a8DIIk2ijWpkhj6oJ5sg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=my3bbns5; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D506B606A33A for ; Fri, 4 Dec 2026 08:43:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=my3bbns5 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE7DB1F000C2; Fri, 4 Dec 2026 08:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796373818; bh=+8bNnHBOWcWE0+qNHpXZEWVzsCfbPxSIoBBdEEBeFW4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=my3bbns5UC0vjNfugL/Y9aUc7LCj0C11mwcvrKv47WKC0nS3A9/TSAZ0mP9V9Nsl3 hT4kEU/HOcqYShimskK16dI1+E2gXWGeBipGO2nJwboyhJ2Yod5+kaQC7ifp4zOnOc 3OR3sCnIgPj6UpFxlwJau3AkbqYdHCwfxaxFm0AYciWYTUyZ59yf2h6H6C13aUc33y Nw/OaTdGX5BflIuQDfAiozvcOMj00MeHqSsxzCNNqBWmGwLUVxJf6cVI5FzshrQYyg D8BaseGmfbodD3bUzazznxHztwF8P6Mp8ThIPtCR5sXKcpYfQZAWmjiBncYV3ZH1pJ RtxjfinWPShtg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] iov_iter: Allow DMA-compatible device pages in bvec extraction Reply-To: sashiko-reviews@lists.linux.dev To: "Naman Jain" , 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 In-Reply-To: <20261203084315.3776182-1-namjain@linux.microsoft.com> References: <20261203084315.3776182-1-namjain@linux.microsoft.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 08:43:37 +0000 X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 > 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 [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. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203084315.3776= 182-1-namjain@linux.microsoft.com?part=3D1