From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 782473DDDAF for ; Thu, 4 Jun 2026 07:51:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780559507; cv=none; b=K008ri1UtOh3hg7eqhppZBwahTfLG2y/F7Ry1k9KjITEh6hiQTOdk8v2W+F2xdH/QL5cM3wV/CX09CW87vyKCBYQZ71OObWl6u6iSGo0Iw+QxSYTmQTgTUUrNc0jeNXrgU1wKM0lMvzI2FbD6lslvF2ksAUKB3RP7ZyKsIHL+40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780559507; c=relaxed/simple; bh=8WhlVEcsH4b/tq9eDNCZXwSzxv7uXGQkdn6QUBxyViw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=snidrbfLkE8kYUJTmxy2KypRP0I4wOFffIQeyIj5sqtilO4nY4tbunDT9zZ2qsA75+4SUQbO9xbUjR3eJkUchoDuUrpeCcXzlhGsH9/WkfJw5jBTSJCGG0Fdyaan6pPFRB7BeHQwAC4i/NSoeHh/MLsVV0feJsNCJXjJyTDjP64= 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=dKeGZspr; arc=none smtp.client-ip=209.85.214.177 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="dKeGZspr" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2bf22c18ad3so84955ad.0 for ; Thu, 04 Jun 2026 00:51:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780559506; x=1781164306; 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=qNu5LGXo8LJ11L0Yl+CMg+JzQgcqgmRZhwXvn5gnfZM=; b=dKeGZspr9Nkniev5POpkqAEb3SHSJ0O2Lgd4ggzSNrSjg92ZR09HN3s6K+bKyD9IsM JBToMwSio/4viaaVxHlhHDzm/DstlA27CFsyBwinm9kW9lk2QNVT7GtoAqFriYDGGGAS eagk+wP8jpoAQrCINdCUxpefUtMjmtqe8zSMI6qGWGQakw4VGr+bVBEkrGU1yp592/UN xw7DV2Zfj+PHUO4TCgo9qAMKdWkOzroOBO1ve15/iu+Uc0v7GbGnw3E/Q9/eSGt/12ED R2mPR9XyaD3wXXzs6nqcPoka6ZmokJoFMsHsh1bq+o62S61pPr10ZiqwsGnVkOLDrBbP X+Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780559506; x=1781164306; 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=qNu5LGXo8LJ11L0Yl+CMg+JzQgcqgmRZhwXvn5gnfZM=; b=KYOf+N6mWR3JUAIKsjOuwdXd/jvxktxh2lbLA7sCSmS/TvhEKBP0+PzjdFgxikz6g2 j9MCiGz3aitvKrxf1NtG1P2m0uKbLb+pePcAjoXHGaPFMOYgHvMV3qBkyQDK3MV/0n7h +GoAJaIVmRIFBUIH1T6hmwwMt/NoYxtMzCGxVrOjbSekYJxJt0MlpgaY4H+aTso1sm1E d5G4LVrbarohHYIYqu/17+0vcQLhCEpv5epZVjvzFY9xu7YBoeOWDJWEqapKR6tAD/+b 4ycdQdg0amegiF/RDeFAlb3mwELVCy3gv3yEUbBww5h+kOKAevReECFslp7jQ1+sABDf 8XNg== X-Forwarded-Encrypted: i=1; AFNElJ+rBrIRdt7Izf7M91d0GesuGnLs4x43R42itSKOaoA19KFOb0m84Rqsl4MHulzpqbMwRkmOQp5VsFO6EiE=@vger.kernel.org X-Gm-Message-State: AOJu0YzUENHoKlODBtdMBfwbpIPNoGSkELpCd5djwsRQjNabtflPn6Qb K2iNWB+ed3tcDZxvrNuKi+iPGLwXEXf9ByGJnKXaUGK+C+lVpJpoRA8kV7Us6L2yIQ== X-Gm-Gg: Acq92OH8D9f+/2tBSdXkJkJfVCrgwV7N+jM6JlstGPIAyBkwu/cFDHqdPSsifV5Bxcl dRYZGJYs177ACrlo5vVZJNX+TG3sfNVUMQ3+XcJ3d6brsrzyWZhKJv76P/DNO8IbniiBAV2mNT0 lXDQVFOKY2Sw30e7M/9C2bk7J1fO69icAReoDz5tvU+0kveF2E+hXX4h9ZqO6gDmSMZm98DWr7/ OoWuZw5ouybbTvMuKtc4Meb0qrXVIrkTqLV2paBCw0VvZ260EMlqOY5jFJbhU6ekl8TUex0msmo UJb1DuN3Kp5jPRpXiPNeKwVcfMQE/0H0atkr3Sl/PrYBggMSHl4iYjx3sgoCidZ3vo2kGXfLu7G H6vafw1VW2d/tejZa4evjUJR30d1KNVKGNQahUpIDZDx+6hSnz8br/bHBvqs4Py+naSldGQzUHQ eQfbZzqyV8l1QKGLxLP9OHfdPXt53M6WTJuzbd1epnQWjwvOak+yabXHU3S4fB3xe16Ea+Bk0= X-Received: by 2002:a17:902:ea10:b0:2c0:b19c:2e10 with SMTP id d9443c01a7336-2c198ab2908mr2389815ad.0.1780559505080; Thu, 04 Jun 2026 00:51:45 -0700 (PDT) Received: from google.com (199.255.142.34.bc.googleusercontent.com. [34.142.255.199]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c16609e636sm48697275ad.51.2026.06.04.00.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2026 00:51:44 -0700 (PDT) Date: Thu, 4 Jun 2026 07:51:39 +0000 From: Pranjal Shrivastava To: Anna Schumaker Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Trond Myklebust , Christoph Hellwig , Christoph Hellwig , Shivaji Kant Subject: Re: [PATCH v1 1/7] nfs: make nfs_page pin-aware Message-ID: References: <20260603053033.3300318-1-praan@google.com> <20260603053033.3300318-2-praan@google.com> <9cd182d7-8f31-499d-aeec-33bf86271fa6@app.fastmail.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: <9cd182d7-8f31-499d-aeec-33bf86271fa6@app.fastmail.com> On Wed, Jun 03, 2026 at 12:39:47PM -0400, Anna Schumaker wrote: > Hi Pranjal, > > On Wed, Jun 3, 2026, at 1:30 AM, Pranjal Shrivastava wrote: > > Modernizing the NFS Direct I/O path to use iov_iter_extract_pages() > > introduces page pinning (GUP) instead of standard page referencing. > > To handle this correctly, nfs_page must track whether it holds a > > pin or a standard reference. > > > > Introduce a new flag, PG_PINNED, to struct nfs_page. Update the creation > > path (nfs_page_create_from_page and nfs_page_create_from_folio) to > > accept a pinned bool and set the flag accordingly. If the page is pinned, > > we skip the existing reference increment (get_page/folio_get) as the pin > > itself acts as a reference. > > > > Update nfs_clear_request() & nfs_direct_release_pages() to use > > unpin_user_page() or unpin_user_folio() instead of only refcount > > decrement (put_page) when PG_PINNED flag is set. Finally, ensure > > subrequests inherit the pinning status from their parent request. > > > > Signed-off-by: Pranjal Shrivastava > > --- > > fs/nfs/direct.c | 22 +++++++++++++++------- > > fs/nfs/pagelist.c | 36 ++++++++++++++++++++++++++---------- > > fs/nfs/read.c | 2 +- > > fs/nfs/write.c | 2 +- > > include/linux/nfs_page.h | 3 +++ > > 5 files changed, 46 insertions(+), 19 deletions(-) > > > > diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c > > index 48d89716193a..80319c5eeed4 100644 > > --- a/fs/nfs/direct.c > > +++ b/fs/nfs/direct.c Hi Anna, [...] > > > > @@ -435,6 +441,7 @@ static void nfs_page_assign_page(struct nfs_page > > *req, struct page *page) > > */ > > struct nfs_page *nfs_page_create_from_page(struct nfs_open_context > > *ctx, > > struct page *page, > > + bool pinned, > > Can you add a description for "pinned" to the kernel doc comment right > above this function? I'm seeing: > > Warning: fs/nfs/pagelist.c:446 function parameter 'pinned' not described in 'nfs_page_create_from_page' Ack. I'll add a description in v2. > > > > unsigned int pgbase, loff_t offset, > > unsigned int count) > > { > > @@ -446,7 +453,7 @@ struct nfs_page *nfs_page_create_from_page(struct > > nfs_open_context *ctx, > > ret = nfs_page_create(l_ctx, pgbase, offset >> PAGE_SHIFT, > > offset_in_page(offset), count); > > if (!IS_ERR(ret)) { > > - nfs_page_assign_page(ret, page); > > + nfs_page_assign_page(ret, page, pinned); > > nfs_page_group_init(ret, NULL); > > } > > nfs_put_lock_context(l_ctx); > > @@ -466,6 +473,7 @@ struct nfs_page *nfs_page_create_from_page(struct > > nfs_open_context *ctx, > > */ > > struct nfs_page *nfs_page_create_from_folio(struct nfs_open_context > > *ctx, > > struct folio *folio, > > + bool pinned, > > Same here: > > Warning: fs/nfs/pagelist.c:478 function parameter 'pinned' not described in 'nfs_page_create_from_folio' Ack. I'll add a description in v2. [...] Thanks, Praan