From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F25438888B for ; Tue, 16 Jun 2026 14:15:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781619324; cv=none; b=p4s5QYrXXUYfuYUvaKWaH0K0gJW7zt2Y4+mRzLkBfaxJ4VCw344TzTB7J6lDgFRR1JW676mr9k3KpqaImQ5WxxyqpPjT63FP/hsAyZh+8879W+AdCOYvMdmZuxorVITkq8Yccj5up+53H9tb3rs7WlIB8cvtgBMjGWdJ85MdLHM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781619324; c=relaxed/simple; bh=/T9gA1Aoj0Pd3tgvpQywM6kVkfTC5cdV4TYQszPSXt4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mL1IjTt+k7UtkJisUihqvr7AOhm782roRp8QvxIpb97CMApeOIQHfPSK/1j2hTYc/ATZen/2maokRv9toXDzYasYiQSI7R3Z8QsxIv2D/4DR1OUahUiqk39wYvN0O4Lq3fUN500XxAbB8LSdS58SEDHe8g+zKx16J1YbvPEw398= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=IiGr9kyl; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="IiGr9kyl" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2c69fa0b1f8so31195ad.0 for ; Tue, 16 Jun 2026 07:15:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781619323; x=1782224123; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ItMFRbLvWzjxJwcjRURBQD+YmZOSPkyn+ogydOCQLjM=; b=IiGr9kylUQ1DtYEEKQjYs/OyEasZkSHGlpa3g8CgPt6B+8F+wGEHM94sqYJAbrs+eq wsixQ6q3BsXszwrhubVcgVrJo7ulR5c0EXhNyqA15W+EhjT6w4ZAjnM875WYmFxSvFB/ YmVBanKuMGMPvuMQwPAYvg2XmTm4TtGCaajNgEiKXkuIxg3i+CtoTGlg/nGU8wpNIMhe G+QFQFF2yK0+52LRZhEOrAO4YIAh7rg27BchFxXKuTn9GK5FKYiJIPpC/1o+ZvZd5pU7 +KLOZkQ7NNShiVfLAGHmYkDiN1QMN5LCjSpdXdNrOzHjrdyMoTpGbPU07D+OH6TCDDbK tlMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781619323; x=1782224123; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ItMFRbLvWzjxJwcjRURBQD+YmZOSPkyn+ogydOCQLjM=; b=hSIQIO52aMjC9u9OqMPzaSo5Z6hSIMwaFSL8TQeUxRVwPjbGDm883csjv8Kca0B1Un YMtppDQNpo908Xah3QN4eT2YY/Ox3CWq+IkbgA2ia/1D+OOOsUEcKj/qdxphBPySzv0p fdGcibtCC/DV/StNvfja/5I2lrXxxwEKjKeF0zO2e98J1V7Tb3FmgdTtmGiusq5OdHA7 QdikDz9AgWgqUub81TzpxHYeKK0vEwermjAdoV5IFbIMMQJMI808F6EAORV0F00D+nqy hw3euSK3Y2bOp09aFwD70FbWcQm0KBcj/mRVF3XARDZgFwPn+hobACYzGigi5L2WKfle L4bA== X-Forwarded-Encrypted: i=1; AFNElJ8hodPxm2IkBBCXu5abnOltzgNmtHX3FYdAizbItSKQOc8zCQg+EBhXguuY3HO9c1mwe7+aE4NyEz3gfeU=@vger.kernel.org X-Gm-Message-State: AOJu0YwFcFc7W5+rCNKWTdxQ67LURFya16NeUwf+C8lueis0dAzUzPqa mlqOd7kcT0s/ZwI1obHhCbfAMCFltG4zLZjmwinDde2DWl3VaGkT0zg4X/unh6ly0w== X-Gm-Gg: Acq92OG3WbnGD7nnTto36YSqf7MVnBXnvWwT1+bfQ3k/f4XEk3y6mQoria8qwbywjyN svlT0kAC+wjRfBUxvRKz6aAur8dQkXqAIdl6Hxz81+QF5g8xMOtAglDcNqewPi+7OTnXyNmACkQ vWa4yaERGZTy7uavc3AOBKL88ojGxGwzOzQGfC209hXTUWx3sUZXjLOuKbA39VQ2HIjKOW0GgIG xrNKmPHIdfN7STL5BZRQhl79YRETgiiKeiosRpudVAKfwsOYZByQdOHpZgghkyupKjej3aqomO9 fu443AgEkK25UBgCUkOvdJw5ipB98hSydbH5r3n/RwDlK0Td+OCQxYJLh0YJL6MpCJVtU7HL4aD o56dRWiPmAU5ow9xe2GnlbPguTsGbktmIQOZC0AVQeYqAf12wlvApgYhnha7tZ8+gucDNV0s2Pr 26MFOLwuXOeAvLXQjVhQ82XWqNIv70N/RyG4SIfN18jduy3JjyLkqEkx4mf7fi X-Received: by 2002:a17:903:fb0:b0:2c1:ee6e:be20 with SMTP id d9443c01a7336-2c69a357a81mr2535505ad.30.1781619321992; Tue, 16 Jun 2026 07:15:21 -0700 (PDT) Received: from google.com (199.255.142.34.bc.googleusercontent.com. [34.142.255.199]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-379c3240b5esm8718527a91.0.2026.06.16.07.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2026 07:15:21 -0700 (PDT) Date: Tue, 16 Jun 2026 14:15:15 +0000 From: Pranjal Shrivastava To: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Trond Myklebust , Anna Schumaker , Christoph Hellwig , Christoph Hellwig , Shivaji Kant Subject: Re: [PATCH v2 0/7] nfs: Modernize Direct I/O path Message-ID: References: <20260616134000.2733403-1-praan@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260616134000.2733403-1-praan@google.com> On Tue, Jun 16, 2026 at 01:39:53PM +0000, Pranjal Shrivastava wrote: > Modernize the NFS Direct I/O path as a preparatory step to enable PCI > Peer-to-Peer DMA (P2PDMA) support. Following feedback on the initial > RFC [1], the modernization and architectural changes are split into > this standalone series. > > Currently, NFS O_DIRECT relies on the legacy iov_iter_get_pages_alloc2() > API which does not support the pinning requirements for P2P memory. > The implementation moves NFS to the modern iov_iter_extract_pages() API > and migrates NFS direct I/O away from pages to use folios. > > Design > ====== > > 1. Pin-Awareness > Standard NFS requests use get_page() and put_page() for memory > management. However, memory extracted via iov_iter_extract_pages() > requires explicit pinning. > > Introduce a PG_PINNED flag and a wb_nr_pinned count to struct nfs_page. > This allows the request lifecycle to track ownership of physical pins > and ensure that unpinning is performed only when the I/O is complete. > > 2. API Migration > Migrate the Direct I/O path to the modern iov_iter_extract_pages() > API. This aligns NFS with the modern extraction model and serves as > the foundation for passing ITER_ALLOW_P2PDMA in a follow-up series. > > 3. Extraction Helper and Folio Support > Introduce a new extraction helper in direct.c to group contiguous > pages from the same folio into a single struct nfs_page. This > effectively migrates the Direct I/O path from being page-based to being > folio-based. > > Note: zone_device_pages_have_same_pgmap() checks are intentionally > omitted in the extraction helper since P2PDMA enablement will be > introduced in a follow-up series. > > Bisectability > ============= > The series attempts to remain bisectable. > > [Patches 1-2] Introduce pin-aware infrastructure and accounting. > [Patch 3] Adds a centralized request release helper. > [Patch 4] Migrates the Direct I/O path to iov_iter_extract_pages(). > [Patches 5-6] Implement the extraction helper and folio-based grouping. > [Patch 7] Removes orphaned page-based helpers. > > Testing > ======= > This series has been tested with xfstests [2] on RDMA & TCP transports: > > ./check generic/091 generic/130 generic/139 generic/143 generic/154 \ > generic/155 generic/183 generic/188 generic/190 generic/196 \ > generic/198 generic/203 generic/214 generic/240 generic/263 \ > generic/287 generic/290 generic/292 generic/330 generic/444 \ > generic/450 generic/451 generic/586 generic/647 generic/708 \ > generic/729 generic/760 > > The following summary was tabulated via a custom script [3] (on github). > [...] > > [1] https://lore.kernel.org/all/20260401194501.2269200-1-praan@google.com/ > [2] https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git Missed [3] https://github.com/pran005/tools/blob/main/display.py > > > [v2] > - Fix data corruption in nfs_direct_extract_pages() by correctly > calculating intra-page offsets using offset_in_page(). > - Fix requested_bytes accounting in direct read/write paths to only > increment after successful RPC scheduling. > - Add missing kernel-doc descriptions for the @pinned parameter in > nfs_page_create_from_page() and nfs_page_create_from_folio(). > - Rebase on fs-next/ Thanks, Praan