From nobody Sat Sep 26 21:13:51 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4645F1F12F8; Sun, 30 Aug 2026 04:19:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063565; cv=none; b=auhvessU6d8jSBDdgQjcQKJA0EGBq9lewSb6Q4ZGqiPARyRthrw9K9R/byyoa2pOz5SXsR/NKhhxEzQ06oEr2QChDP2gh3u5970wRAhkRGHc/3aZQFlUqsmh2NLrgIUwwXVvv5xobAeWXZPhEe0kipdP55JCR73nttAXy3URoYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063565; c=relaxed/simple; bh=C8hUjnmlQCxlKFOFVhkHh9N/nmYL4/89xmS6iyo4pqk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ejcSXIPK2lBEKc08v87QGOJV9BtdSpuewctWdxxzHWaPuFDY1eeaS1zfL3VbucMXlhTEaesIv9RMat5qvW7ZUPOAvYUKwse35OgFKeJ6ND8C9g+HsDxSqZWqTxfeplOz3TQJuYyw+y8sG1vKQ5nw/Pk02JvghNFaIEnulPMTXGc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Ia8PDE2J; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Ia8PDE2J" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=HX1YDxtUboff1x1jxC0V0517QCG7T5Er/z3xEiz/4yI=; b=Ia8PDE2J2L592KXDaHpWvWTj85 NBPDULnBAmGG3IioI8moIoKt27O8MzhWpiF8X5mkvtK2f3gT2lxyE+rovkiLoGZtaNu8rpXjLzE1X y/qzn8ph0pq9AyJyutBn4yxdtnrIG0I8ie7p7DUyEhGMr3vxcqeAuXOXcrXgJKOhdbS019CrIK8kp ALBRFMAZRUNq78CHH7EUDPXo6vM6jpwZmR2bj/GcxFtVZUjPIQzsV5t3qGR6z1Toj4PBbKVodMH3Q ql0J0/GC6hH8KdGVCXhVvfOwE0SQ+c00DRGQ6Vfe2QpfB0R05sIakJVbP+ObSEpkWWLCLjwX4QaBC GqtlndIg==; Received: from willy by casper.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0X0Y-000000000hM-42LV; Sun, 30 Aug 2026 04:19:02 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , Jan Kara , Gao Xiang , Chao Yu , "Theodore Tso" , Trond Myklebust , Anna Schumaker , Namjae Jeon , Hyunchul Lee , Phillip Lougher , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/9] mm: Improve memalloc_nofs_save() documentation Date: Sun, 30 Aug 2026 05:18:48 +0100 Message-ID: <20260830041901.2668-2-willy@infradead.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260830041901.2668-1-willy@infradead.org> References: <20260830041901.2668-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Talk about why someone should call this function instead of what this function does. This makes the long comment in mm/readahead.c obsolete; replace it with a comment about which case we're protecting against. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara --- include/linux/sched/mm.h | 31 +++++++++++++++++++++++-------- mm/readahead.c | 14 ++------------ 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h index d7c6a942aa7e..f76be1141b06 100644 --- a/include/linux/sched/mm.h +++ b/include/linux/sched/mm.h @@ -372,13 +372,26 @@ static inline void memalloc_noio_restore(unsigned int= flags) } =20 /** - * memalloc_nofs_save - Marks implicit GFP_NOFS allocation scope. + * memalloc_nofs_save - Prevent recursion into the filesystem. * - * This functions marks the beginning of the GFP_NOFS allocation scope. - * All further allocations will implicitly drop __GFP_FS flag and so - * they are safe for the FS critical section from the allocation recursion - * point of view. Use memalloc_nofs_restore to end the scope with flags - * returned by this function. + * All memory allocations between calling this function and calling + * memalloc_nofs_restore() will be prevented from calling into filesystems + * to reclaim memory. Clean page cache memory can still be reclaimed, + * but (for example) inodes will not be. + * + * The primary reason to do this is that the caller has taken a lock + * which would be needed by FS reclaim. While we could theoretically + * call into a different filesystem in this case, it can be a deep call + * stack so it is better to avoid all filesystems. + * + * Filesystems often choose to incorporate a call to this function as part + * of starting a journal transaction. While not a lock in the normal + * sense, it has much the same effect as nested journal transactions + * are either prohibited or expensive. + * + * Also call this function if you need to allocate memory while holding + * a file folio locked. High order allocations (such as those requested + * by slab) can trigger compaction which will attempt to lock the folio. * * Context: This function is safe to be used from any context. * Return: The saved flags to be passed to memalloc_nofs_restore. @@ -389,10 +402,12 @@ static inline unsigned int memalloc_nofs_save(void) } =20 /** - * memalloc_nofs_restore - Ends the implicit GFP_NOFS scope. + * memalloc_nofs_restore - End filesystem reclaim scope. * @flags: Flags to restore. * - * Ends the implicit GFP_NOFS scope started by memalloc_nofs_save function. + * Ends the implicit memory allocation scope started by + * memalloc_nofs_save(). This may not enable access to filesystem reclaim + * if it was already disabled at the time memalloc_nofs_save() was called. * Always make sure that the given flags is the return value from the * pairing memalloc_nofs_save call. */ diff --git a/mm/readahead.c b/mm/readahead.c index 6e5563290287..9c116d4ba963 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -227,17 +227,7 @@ void page_cache_ra_unbounded(struct readahead_control = *ractl, gfp_t gfp_mask =3D readahead_gfp_mask(mapping); unsigned long mark =3D ULONG_MAX, i =3D 0; unsigned int min_nrpages =3D mapping_min_folio_nrpages(mapping); - - /* - * Partway through the readahead operation, we will have added - * locked pages to the page cache, but will not yet have submitted - * them for I/O. Adding another page may need to allocate memory, - * which can trigger memory reclaim. Telling the VM we're in - * the middle of a filesystem operation will cause it to not - * touch file-backed pages, preventing a deadlock. Most (all?) - * filesystems already specify __GFP_NOFS in their mapping's - * gfp_mask, but let's be explicit here. - */ + /* Allocating with locked folios */ unsigned int nofs =3D memalloc_nofs_save(); =20 lockdep_assert_held(&mapping->invalidate_lock); @@ -512,7 +502,7 @@ void page_cache_ra_order(struct readahead_control *ract= l, =20 ra->order =3D new_order; =20 - /* See comment in page_cache_ra_unbounded() */ + /* Allocating with locked folios */ nofs =3D memalloc_nofs_save(); filemap_invalidate_lock_shared(mapping); /* --=20 2.47.3 From nobody Sat Sep 26 21:13:51 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54FA942A80; Sun, 30 Aug 2026 04:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063555; cv=none; b=UMPf8gGM8wZF7alBBsT+QFlysjE6brV136tZkYoaMNI5r8ht1PmCLkS4NIRwuE1jcSPP/VS+AxK48kKxRFQQDim9X+oUY+c/VYFUbAR+S/HvF16fpUq6GKsO18hNTx7cB3J/6iBqfIR0XKx3aXqrr6ouRr7T2BwNJJA4oxIUPcQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063555; c=relaxed/simple; bh=Moci7V+P1zPT6tbrwh3rkPHgeiAFL932fyc34PPL1O8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=asdcRWkq3kxbQ7ztes/FNs/b8JsXQCYuqnejrpl3XtOwe3HTSbS7EWsFhdOsA+9nZMP8ddvSubCdCbcAkPVOovyhKQOKAXAjLpSTsb/7pGIjnxAicZrqBi1Pc/7KJQOpgLZwxiN5uPSHoiJu8pwcHhQX7Fmfzny3AgX6yVM2wv0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=TisMTFuh; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="TisMTFuh" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=17KDooFJoYeOcgqtwlU5ofiBDQP57dVuWi84LFJRoDU=; b=TisMTFuhPCehbA7/9nutMd5vZd dGAVseYx9yVTpk//u4fNFf54zujpuIxBHFGc46tKpAUpq1GZxXRPYSn7FYTAklF/bfAtpWBCIi0oC 1J3BDbE+FEpcCaXt3JF9blBGINHRtNtYhss61eG4phR8MkG4W5HyPetKV9dWjA59icSHtWvcNRJGN GiKLqnHuePZ0aPQJE7gGK8fblo+0p7PB2bv+IKL2GOeSR7hWHlnEOEqpTCSnX98Tgprf0NJ7dTnYt 1ZXY+Z4uZeCw3nVDigJ0ICzRwqLlMVt5EZEKarX+tOuSAxr98ZRt2QwuDcnBtoKP22oJ8qCVci5uH unmVDQ0g==; Received: from willy by casper.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0X0Z-000000000hO-0BzY; Sun, 30 Aug 2026 04:19:03 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , Jan Kara , Gao Xiang , Chao Yu , "Theodore Tso" , Trond Myklebust , Anna Schumaker , Namjae Jeon , Hyunchul Lee , Phillip Lougher , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 2/9] ext4: Remove uses of FGP_NOFS Date: Sun, 30 Aug 2026 05:18:49 +0100 Message-ID: <20260830041901.2668-3-willy@infradead.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260830041901.2668-1-willy@infradead.org> References: <20260830041901.2668-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Both of these locations are called while a transaction is in progress. Starting a transaction uses memalloc_nofs_save(), so we are already prevented from recursing into the filesystem and using GFP_NOFS was unnecessary. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Theodore Ts'o Reviewed-by: Baokun Li Reviewed-by: Jan Kara Reviewed-by: Zhang Yi --- fs/ext4/inline.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index ceee69a66482..1884abb09614 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -601,9 +601,7 @@ static int ext4_convert_inline_data_to_extent(struct ad= dress_space *mapping, goto out; } =20 - /* We cannot recurse into the filesystem as the transaction is already - * started */ - folio =3D __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN | FGP_NOFS, + folio =3D __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN, mapping_gfp_mask(mapping)); if (IS_ERR(folio)) { ret =3D PTR_ERR(folio); @@ -734,7 +732,7 @@ int ext4_generic_write_inline_data(struct address_space= *mapping, goto out_release_bh; } =20 - folio =3D __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN | FGP_NOFS, + folio =3D __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN, mapping_gfp_mask(mapping)); if (IS_ERR(folio)) { ret =3D PTR_ERR(folio); --=20 2.47.3 From nobody Sat Sep 26 21:13:51 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F28AD2DEA68; Sun, 30 Aug 2026 04:19:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063577; cv=none; b=TNFHOSY5JQGr5sOGY26avbCbMDCE/667RRrzF0j9n3QdFfPMtYjBoKSbogxnx+QKorTVPOfmr3hCIJU3fYvyjzCkaIr1MgobaN+pBnH9qMQcjov5jRl5htjUMrcQbwF1FXhc9mB01J3Mlr3W5hTMBKGjxGX9kmZ1/YjqaUwWOOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063577; c=relaxed/simple; bh=WL/B100/GmCmY95cHZGZ96sF5d7nwV/mGfptUmKPP7A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CD3GbcMEc7p7nqJiSDPHy3BQU1Hn8D1dgfd6YfuQ4y03YOa6id2VNJeapV8hNIg6SbzVdCvmXUtkuKQFLGYMC40PT0VXOEO5JPh9hHq7oM5asvYtdlOQPuWLotkEYlTiBGPQ0l08BW8YC1kukKNAC43rbgE2StXmtDEiciJPnzk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=ZYfiTFLB; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ZYfiTFLB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=yrBK9zAVRuWrfCGTpwW8HiqL2BzA7MjQTeYnO4XWRqM=; b=ZYfiTFLBbqpdaWTdAiqc0+5xJO 44XPrYZU6F4MGY/PtsCU8/I8FsN60fK+PLVNyFLOolQBLhPVG4oAy5ghiGXh3XA6i/J8LrLNlo1gS nRD1GPEqKKMUK1wKAK3kF8msLk4fxe0AnMcFu6iWeHAQ/J+5S2aFm/tnFPN7QjjcMKL2r40t93fJO iZEBXKfJRTsrPd1dKa/7324uldDA6fT9fizmRe62wSkq1l2cgf5cGHSNieSrJSrGjzuHeudQfxZwe 36jH284GDJM01IX/0tCWU5I0AQj8pu6NkuPaA+ZB5fcN6kKlOk0Z0pCzUTrAL+zeI8fN6sy5EkstX GOyKOdMA==; Received: from willy by casper.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0X0Z-000000000hQ-0aEV; Sun, 30 Aug 2026 04:19:03 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , Jan Kara , Gao Xiang , Chao Yu , "Theodore Tso" , Trond Myklebust , Anna Schumaker , Namjae Jeon , Hyunchul Lee , Phillip Lougher , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 3/9] erofs: Remove redundant FGP_NOFS Date: Sun, 30 Aug 2026 05:18:50 +0100 Message-ID: <20260830041901.2668-4-willy@infradead.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260830041901.2668-1-willy@infradead.org> References: <20260830041901.2668-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The flags already include FGP_NOWAIT which prohibits all reclaim, not just reclaiming from the filesystem. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Gao Xiang Reviewed-by: Jan Kara --- fs/erofs/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index 65974e57aebf..84b3cdc8e88f 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -327,7 +327,7 @@ static inline struct folio *erofs_grab_folio_nowait(str= uct address_space *as, pgoff_t index) { return __filemap_get_folio(as, index, - FGP_LOCK|FGP_CREAT|FGP_NOFS|FGP_NOWAIT, + FGP_LOCK | FGP_CREAT | FGP_NOWAIT, readahead_gfp_mask(as) & ~__GFP_RECLAIM); } =20 --=20 2.47.3 From nobody Sat Sep 26 21:13:51 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B65C12C026C; Sun, 30 Aug 2026 04:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063580; cv=none; b=MLsCEyTNup3xi7Ewm/dwO7aQpy5nJzwgLqhC2qeMpqOCtRz/LNPaYLCDAhNvsAec1l5YMNVFKr6PBBVeZXXBGhW2HuTaj7Fyae8hmCR6AOhnOldnKoyaBj/YyiV/bf0We3xpqwk+O4VH+MEgtKM/oe/fcZmzgIYo14OHSJHvEOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063580; c=relaxed/simple; bh=ua77bB9lJzzsPGvmDjWHUiYJnv0U/TicIHtRpmrjyIU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h4KblhwYl7jJovXsUzQyQobe7VT7YQliHet6yj01ERuJ6oEHFZYmF62v4E+11eFOzYv4QignaoKK2CGWYgD4tVM/XaXQTjk6SW0Ua1kKeQ8jMOsfEqWZHugfx9Hx3IrQgz0SGP2jHR3+aLZhJXCMTO0Egly1/DZtkVkf7BqsXgU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=jmnyzAGh; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="jmnyzAGh" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=tsfpWnTEEugF5BhxxP0f5NSzcOBwxx6do+o7r7CRpoM=; b=jmnyzAGhnXUs0+C5LS24e7OvOs zECGaQnz/K7uDPY+0u1wIf57vrFCgxSAVDmXvvj2TMBVH3TwhpYMMCjU/iKIiKTFWX3wS6ki66JzL u+cDYy9gVlfHAwnU21whEjN+K2q/N4jfjfUTBerTfCmMcehN/SHRRgR81UCMVMH1utVmJ4lkryx73 gukk3XpXRgPtZ+cK2nFL5ks8imp9XnV9WbnbHY6KaDnzoVrezcKyrtL4QpAosis5BrPyRe81xoTst U6BQxwL8QcjppnnEieucNP8b4nPqOQuTwxvZKv4tOIF7s0w4u3IBCUeo+jof7AAqQejsMCVDHmuHG SfbA0xNQ==; Received: from willy by casper.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0X0Z-000000000hS-0u4B; Sun, 30 Aug 2026 04:19:03 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , Jan Kara , Gao Xiang , Chao Yu , "Theodore Tso" , Trond Myklebust , Anna Schumaker , Namjae Jeon , Hyunchul Lee , Phillip Lougher , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 4/9] nfs: Remove redundant FGP_NOFS Date: Sun, 30 Aug 2026 05:18:51 +0100 Message-ID: <20260830041901.2668-5-willy@infradead.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260830041901.2668-1-willy@infradead.org> References: <20260830041901.2668-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The flags already include FGP_NOWAIT which prohibits all reclaim, not just reclaiming from the filesystem. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara --- fs/nfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 49394123bd09..e34125a8a2e2 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -447,7 +447,7 @@ static struct folio *nfs_readdir_folio_get_next(struct = address_space *mapping, struct folio *folio; =20 folio =3D __filemap_get_folio(mapping, index, - FGP_LOCK|FGP_CREAT|FGP_NOFS|FGP_NOWAIT, + FGP_LOCK | FGP_CREAT | FGP_NOWAIT, mapping_gfp_mask(mapping)); if (IS_ERR(folio)) return NULL; --=20 2.47.3 From nobody Sat Sep 26 21:13:51 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30AAA2C11DE; Sun, 30 Aug 2026 04:19:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063556; cv=none; b=fhyTjcPH15kM2uJk2/XH5a7bb/eFMFa8FE14naW5Mlg4T0naRrTto/acLUM9w6nvAzHGn+MAQfKu5P2xGvHMu56xHncnIyFtywkXsbP/KIQbSEbXAEBHFuxh/e1IZzkaH3XG9ERE31xdjfwDvtAD2Kl5RailKfGi3K/+rlY7SXE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063556; c=relaxed/simple; bh=aWSEht8+k0dcbwQPIehIYxgvNbjB/2HtXEJKffN+Zak=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f0+E5kKj9YhAojdQoMirSwcwyqDQ6t9v8M3CrQDGrhrx42EKB+TdpWvdHRNynVIt3eaNmn31BVhr2ga4mTeJgjMDmjvOuRDpfQysKANi94/aA0RqjstYQdh9ZTmLkc3Y7YPKoCTYYNCuI3lnWFceDe5u4nBdExh2p/c3wKfox+M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=WlAnPemS; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="WlAnPemS" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=sAVqQaDD0nzQkp3zhExFeGOqa+2+Hy4Fdk9PRQI1fM0=; b=WlAnPemS/R3wjjMsjkr3aofwS9 6+ju9+kQC8VWeYQe+2IMhIT2Ko4MIpm9T7B0Lmm4+/Uf13Fwv8n715o7H+hWFddniZcLhAJHjjiiT aA/migYecE82jkMkMMno5/JuEXsrfN8WoUpiMiBkPVeWqz6axs0dVwulU9dCBTp+IdoSnPAkf8xcF YL0wyjvMwNGrulHZepPot54Pow7G/n21dtGCExy83ftylOY2SG0+rm98uLlu8rzis9gkxjUassWDi GOIryltiIV4homH5urnoNY/qK3Nlb1+CoSZyheJTky/4EyXoGDGMC8FQvASOJOANDxQLnuv/J2DyQ 0jOAQa3g==; Received: from willy by casper.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0X0Z-000000000hU-1DZI; Sun, 30 Aug 2026 04:19:03 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , Jan Kara , Gao Xiang , Chao Yu , "Theodore Tso" , Trond Myklebust , Anna Schumaker , Namjae Jeon , Hyunchul Lee , Phillip Lougher , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 5/9] ntfs: Remove FGP_NOFS from __ntfs_inode_resident_attr_pwrite() Date: Sun, 30 Aug 2026 05:18:52 +0100 Message-ID: <20260830041901.2668-6-willy@infradead.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260830041901.2668-1-willy@infradead.org> References: <20260830041901.2668-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" I do not believe that FGP_NOFS is needed here. This function is called from one place (ntfs_inode_attr_pwrite) which calls either this function or __ntfs_inode_non_resident_attr_pwrite(). The latter function does not use FGP_NOFS in its calls to allocate pagecaache memory, so it should not be needed here either. If it turns out to be needed by both functions, then we should use memalloc_nofs_save at a higher level to protect both of them. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Namjae Jeon --- fs/ntfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 32edb4045178..36a0d6b26c02 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -3676,7 +3676,7 @@ static s64 __ntfs_inode_resident_attr_pwrite(struct i= node *vi, mark_mft_record_dirty(ctx->ntfs_ino); =20 /* Keep the first page clean and uptodate */ - folio =3D __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN | FGP_NOFS, + folio =3D __filemap_get_folio(mapping, 0, FGP_WRITEBEGIN, mapping_gfp_mask(mapping)); if (IS_ERR(folio)) { err =3D PTR_ERR(folio); --=20 2.47.3 From nobody Sat Sep 26 21:13:51 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 652FD1F12F8; Sun, 30 Aug 2026 04:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063554; cv=none; b=PFt8FnJ+5mncwtyRsNnXuvpfXDaVDGsMxEVww4Ln4voOzjVWCJXN80qPr+Xfd5uK6aPPCqVCiF8fQ0wvb/5QKBdgSwTpZlFM2jhZK2BVRSxbgxRh6jPvXfuWHQLCZswwAg3oApRqIy0FhfFbsslQURDKv8j1iRpBMeWTRthq2w8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063554; c=relaxed/simple; bh=1BfozxAkZI4GJuY+2tupzCtnc4HTR8TVO9JGgWl3duU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aQzatYU69DUazxEjS8vtdLp09up0UAnapWX21LpKOvhH07TCq/Kmh278VNcfISS1NcDockDZ2Jb4zlQ+CF5e3U6hzxVFzAZ3lqtYoUQi5M0aGiEH6io7G3emlglDkva+i2kJiizKrV7ar6ULyM1ROTzSY4koc22y3QkKrM/pUIs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=kq9hbcwK; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="kq9hbcwK" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=dejHJnjtKaOM8kEBucRI9H7VqzSRiRdAVrdQgRGUFkI=; b=kq9hbcwKXkJ4J1vRrFYKTsZrzz 6lUCw4ImNf0uzG7wmavDvL2d1b1zE8A/RpsFFBEd2KjgADVNelaeu+Cc2ft0JaNcevE7WuveiN7Hb tuuPLC7wUk69v4nkxbWpYMUDTfv9hB1Rd+51IvuOI4rXruVCB/9lK9RX1+qkSSlUe/PNQoGfnKbnr FbqvDhWB9HA1L6PBoHuVyoe3P+DiWEWuQlRK2pYw1HhzYEuIWWYCtbW/rzc5y5iVbW1pda9V9RBwl edUQp11krj3umqsJsfHJRhphqubpVr29NMhHxEytCZURqMJYmtIFItwO3XcpwP+SOtdsg84LGxNjv 2q6HPnXQ==; Received: from willy by casper.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0X0Z-000000000hb-1c0i; Sun, 30 Aug 2026 04:19:03 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , Jan Kara , Gao Xiang , Chao Yu , "Theodore Tso" , Trond Myklebust , Anna Schumaker , Namjae Jeon , Hyunchul Lee , Phillip Lougher , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 6/9] ntfs: Remove redundant FGP_NOFS from ntfs_wof_collect_dest() Date: Sun, 30 Aug 2026 05:18:53 +0100 Message-ID: <20260830041901.2668-7-willy@infradead.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260830041901.2668-1-willy@infradead.org> References: <20260830041901.2668-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The flags already include FGP_NOWAIT which prohibits all reclaim, not just reclaiming from the filesystem. Use mapping_gfp_mask() instead of GFP_NOFS as this will preserve flags like GFP_MOVABLE. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Namjae Jeon --- fs/ntfs/wof.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/ntfs/wof.c b/fs/ntfs/wof.c index 8f84c2212eee..c981b4a3b695 100644 --- a/fs/ntfs/wof.c +++ b/fs/ntfs/wof.c @@ -464,10 +464,9 @@ static int ntfs_wof_collect_dest(struct address_space = *mapping, folio =3D target; is_target =3D true; } else { - folio =3D __filemap_get_folio( - mapping, index, - FGP_LOCK | FGP_CREAT | FGP_NOFS | FGP_NOWAIT, - GFP_NOFS); + folio =3D __filemap_get_folio(mapping, index, + FGP_LOCK | FGP_CREAT | FGP_NOWAIT, + mapping_gfp_mask(mapping)); if (IS_ERR(folio)) return PTR_ERR(folio); is_target =3D false; --=20 2.47.3 From nobody Sat Sep 26 21:13:51 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5428B2EEE86; Sun, 30 Aug 2026 04:19:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063569; cv=none; b=CxLBGGmmJApiNNm/9AcQHyyuVX74CCI+ax+8XbI3ZgTgFibb39nAnul60B1mdqJ4aJ5iyqSqrmlJ4WvHQ9DIlQNTHwTlRf8HABXA83Jo90CMFHShVhXikRvcTIa8dnHAbqSt/T7PDm2ShRSDHswPM+CcCALl9yyfxZavglYhEoQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063569; c=relaxed/simple; bh=JeraOrinGK6TEbRIavBIgntacVnb1B5D7qODMS5lJ1s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QdazyZ0Nrp8Af03MYijBB7cdK5NLNzXcp81Ur8MTYkO0N1JDEvWHDA8uI3L161YhIxXezyNN1bMp29sXFidZ6rIJ6qBB/XCnV3rtFJTMsoMVeTajEKn1+ntnmHFb7efi819qAtVjbNCYk8mpVESf6h4ZlnJnEZVzhrJppXx/S94= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=L037xD86; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="L037xD86" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=iOsUEQiX5hPPz6sUPul1Vy0rSyJQxXGSiFeQvRVO8q0=; b=L037xD86tbRevrRc914UOatghV p+tn3zXNS1KjRC7ubVd5/qGwTQYn67z7oD8fyhA7G9ULdUFo+SleMrRPBP2CXoDSeI/7al9q9nIBh bmvFtG3Y5i5bMroPMma4KLePX0fwM4bTu9I2VJ5gXVLsypFk64Gnc/qCG7u567/hwq8yGZliK/Zvc mp+qCjf6x5LPR33alJLx9+FDr9EgLfA9qOEQWikc5b8t/EBAvvRKPq/rfyqVNKKFKh6WXwWwv2OGf vwRlTrodbR9EbM/Z0xfKyBR0cszGGhcIfowJ6uc6nEYVcihEAwYLp019cM9AJ+pEp5IabkI6qHXVM QYpBsLrA==; Received: from willy by casper.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0X0Z-000000000i3-26Vc; Sun, 30 Aug 2026 04:19:03 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , Jan Kara , Gao Xiang , Chao Yu , "Theodore Tso" , Trond Myklebust , Anna Schumaker , Namjae Jeon , Hyunchul Lee , Phillip Lougher , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 7/9] squashfs: Remove use of FGP_NOFS Date: Sun, 30 Aug 2026 05:18:54 +0100 Message-ID: <20260830041901.2668-8-willy@infradead.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260830041901.2668-1-willy@infradead.org> References: <20260830041901.2668-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since we can allocate memory while holding a folio locked, we cannot allow page reclaim to call into the filesystem and attempt to compact the folio we're currently holding locked. Use memalloc_nofs_save() instead of FGP_NOFS here. Signed-off-by: Matthew Wilcox (Oracle) --- fs/squashfs/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c index d83594ce91d2..34c550a266bc 100644 --- a/fs/squashfs/file.c +++ b/fs/squashfs/file.c @@ -398,6 +398,7 @@ void squashfs_copy_cache(struct folio *folio, struct squashfs_sb_info *msblk =3D inode->i_sb->s_fs_info; int i, mask =3D (1 << (msblk->block_log - PAGE_SHIFT)) - 1; int start_index =3D folio->index & ~mask, end_index =3D start_index | mas= k; + unsigned int nofs =3D memalloc_nofs_save(); =20 /* * Loop copying datablock into pages. As the datablock likely covers @@ -415,7 +416,7 @@ void squashfs_copy_cache(struct folio *folio, =20 push_folio =3D (i =3D=3D folio->index) ? folio : __filemap_get_folio(mapping, i, - FGP_LOCK|FGP_CREAT|FGP_NOFS|FGP_NOWAIT, + FGP_LOCK | FGP_CREAT | FGP_NOWAIT, mapping_gfp_mask(mapping)); =20 if (IS_ERR(push_folio)) @@ -430,6 +431,8 @@ void squashfs_copy_cache(struct folio *folio, if (i !=3D folio->index) folio_put(push_folio); } + + memalloc_nofs_restore(nofs); } =20 /* Read datablock stored packed inside a fragment (tail-end packed block) = */ --=20 2.47.3 From nobody Sat Sep 26 21:13:51 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52673261B8A; Sun, 30 Aug 2026 04:19:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063565; cv=none; b=cFYh38BzhobjHOlpfC8O4W0SWMLpV+8RNXvH+IwmmXH/MgHVosh7/WYlSzMJeO/DhGY8ZNDrxBnmt6XMZxUmkZ4C7NPC8h/kBEts+ZEuqFQDknWMQu7qvl+qOJsoYXJkYazYv4eXWLzSS332iVr/tJ/ESsrs2YFmRXzjaea4QI8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063565; c=relaxed/simple; bh=drvPQ9zuvtVNEjvfWiGpirm5x1lLi5QfiCnjV5PlNiw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lgUYI4YAksffEsdtMiIACi7VckLvKVZN3vjuRa/MolARPZe1zF7qqReeNWxDbUSqRodrjSryLsUm7ILXG8uCJpopFHfaeJvnVyrskv6+C2N+v1ntCWsgCYsWX/xatJNLqSmhkVKx0vTnn2Q4NLEX1KJbtC/KI3QWCXenumivYSc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=St5YwczI; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="St5YwczI" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=/LhwqzyL2tHWHjKBCqUfd5fZsEqJTMNd4JrJ5Ssrbtk=; b=St5YwczIjGD0oycKcDall0vCVj B/1aacESJcnXac0qwwdgA/3w7ddFCpbvgsmZ/nlVJWobcV88bxg9CPvLkAGBCmV8ocwJagWRH8n/Q F216KC+E/t18eabT9+uXGIANM5zKCAR54zmlgGDg86mc8YESyhqBWaZu0k8XEEXkc7+Ll73JN1N9e S0K736Ep457HSJh8byMrQqKhowm2Z2zDnpX+PtHZrMZDRAXNuO8Q2e3KDVtpG2GzHgIXlWZUeiWzt KYUd1hZSWA+A5i6//HQpp0cdcprL0TWsBtQFQSGfDQWm31miYDxSCH2g/AIYWfGA5lOLoy0abA+8C 1XFm7/+Q==; Received: from willy by casper.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0X0Z-000000000i5-2UZC; Sun, 30 Aug 2026 04:19:03 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , Jan Kara , Gao Xiang , Chao Yu , "Theodore Tso" , Trond Myklebust , Anna Schumaker , Namjae Jeon , Hyunchul Lee , Phillip Lougher , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 8/9] filemap: Remove redundant FGP_NOFS Date: Sun, 30 Aug 2026 05:18:55 +0100 Message-ID: <20260830041901.2668-9-willy@infradead.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260830041901.2668-1-willy@infradead.org> References: <20260830041901.2668-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The flags already include FGP_NOWAIT which prohibits all reclaim, not just reclaiming from the filesystem. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara --- include/linux/pagemap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 0adfa6605653..3974b063a049 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -929,7 +929,7 @@ static inline struct page *grab_cache_page_nowait(struc= t address_space *mapping, pgoff_t index) { return pagecache_get_page(mapping, index, - FGP_LOCK|FGP_CREAT|FGP_NOFS|FGP_NOWAIT, + FGP_LOCK | FGP_CREAT | FGP_NOWAIT, mapping_gfp_mask(mapping)); } =20 --=20 2.47.3 From nobody Sat Sep 26 21:13:51 2026 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9D8525B090; Sun, 30 Aug 2026 04:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063565; cv=none; b=m1cF1CatlepV0EuwzgDuMN6AZAOHvru+z1B756M/suxEmctGrBnQDWzLI7LARc0/aL++FyUL4tA0CZEzdRebEW/K5NNV/etkbxyraBgQkHMFoWbXfXztrh+UCI4fMUDufYqZzCDUDz4C1YwSNST1A+0SfZzHWgOr6yD/r5M8a1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788063565; c=relaxed/simple; bh=mBJBVACiLTDSzt30yuy5vMYTlu5/Pc66RyndQwm240o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WPCUR4cA6S6NSkuG48p82vlpQ/k6qVqEj7tZ/RF7yihxBe2E9nxT4BFl0DzmsOgk9+i2D9WhyGB5BsvSjW9ieq4fvhNTyyz6HKiaBQHHSAVEb2/1mbvELfBefkXeHfztFOdNPDW/Bni8gNwKqgD5/G4Fm262CN6lE24GlQUKbZI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=dl4JOhdj; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="dl4JOhdj" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=E9PhFISLskt0G9jrpDuqAu5vcSeLsmZLZhXWQ4ku/eI=; b=dl4JOhdjy5Ky53MMIMMBSBjxka GMyBrCs+KW2T06hsemYTZsbViVEsYqH6IaNoiFeMIOs23zFgdkh5S85D4oEtrKsHkfOgxzhps21Kh 6NpoQaSvy8g3bfy7JVTIHe7QClXeT/eCwfxNkZomI5FDA1vK8kOFGCVOXEqBcAIU07qbwq64YXybZ ZYvDvIoj6CbhKrL2AetEuVzCnYNaBocvwGaeqPf/lQS+EcUHCgTIgf/W9rTKkkPkc/ba67HcDVp4Q 9CgcYBOQTK5Du77A8ZYIfso3emJlI1o86I2tmoE58/7/o6UdqqDwrPtwAXs6hbhhEd6NkD7c8n0Yi CDA201oA==; Received: from willy by casper.infradead.org with local (Exim 4.99.1 #2 (Red Hat Linux)) id 1x0X0Z-000000000i7-30zs; Sun, 30 Aug 2026 04:19:03 +0000 From: "Matthew Wilcox (Oracle)" To: Christian Brauner Cc: "Matthew Wilcox (Oracle)" , Jan Kara , Gao Xiang , Chao Yu , "Theodore Tso" , Trond Myklebust , Anna Schumaker , Namjae Jeon , Hyunchul Lee , Phillip Lougher , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 9/9] filemap: Remove FGP_NOFS Date: Sun, 30 Aug 2026 05:18:56 +0100 Message-ID: <20260830041901.2668-10-willy@infradead.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260830041901.2668-1-willy@infradead.org> References: <20260830041901.2668-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There are no more users of FGP_NOFS. Remove it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara --- include/linux/pagemap.h | 10 ++++------ mm/filemap.c | 2 -- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 3974b063a049..bff8b7264fb0 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -697,7 +697,6 @@ pgoff_t page_cache_prev_miss(struct address_space *mapp= ing, * folio is already in cache. If the folio was allocated, unlock it * before returning so the caller can do the same dance. * * %FGP_WRITE - The folio will be written to by the caller. - * * %FGP_NOFS - __GFP_FS will get cleared in gfp. * * %FGP_NOWAIT - Don't block on the folio lock. * * %FGP_STABLE - Wait for the folio to be stable (finished writeback) * * %FGP_DONTCACHE - Uncached buffered IO @@ -710,11 +709,10 @@ typedef unsigned int __bitwise fgf_t; #define FGP_LOCK ((__force fgf_t)0x00000002) #define FGP_CREAT ((__force fgf_t)0x00000004) #define FGP_WRITE ((__force fgf_t)0x00000008) -#define FGP_NOFS ((__force fgf_t)0x00000010) -#define FGP_NOWAIT ((__force fgf_t)0x00000020) -#define FGP_FOR_MMAP ((__force fgf_t)0x00000040) -#define FGP_STABLE ((__force fgf_t)0x00000080) -#define FGP_DONTCACHE ((__force fgf_t)0x00000100) +#define FGP_NOWAIT ((__force fgf_t)0x00000010) +#define FGP_FOR_MMAP ((__force fgf_t)0x00000020) +#define FGP_STABLE ((__force fgf_t)0x00000040) +#define FGP_DONTCACHE ((__force fgf_t)0x00000080) #define FGF_GET_ORDER(fgf) (((__force unsigned)fgf) >> 26) /* top 6 bits */ =20 #define FGP_WRITEBEGIN (FGP_LOCK | FGP_WRITE | FGP_CREAT | FGP_STABLE) diff --git a/mm/filemap.c b/mm/filemap.c index 6afec636881f..e6580291f218 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1994,8 +1994,6 @@ struct folio *__filemap_get_folio_mpol(struct address= _space *mapping, =20 if ((fgp_flags & FGP_WRITE) && mapping_can_writeback(mapping)) gfp |=3D __GFP_WRITE; - if (fgp_flags & FGP_NOFS) - gfp &=3D ~__GFP_FS; if (fgp_flags & FGP_NOWAIT) { gfp &=3D ~GFP_KERNEL; gfp |=3D GFP_NOWAIT; --=20 2.47.3