linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] fs: Remove redundant __GFP_NOWARN
@ 2025-08-03 10:22 Qianfeng Rong
  2025-08-03 10:22 ` [PATCH 1/4] bcachefs: " Qianfeng Rong
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Qianfeng Rong @ 2025-08-03 10:22 UTC (permalink / raw)
  To: Kent Overstreet, Eric Biggers, Theodore Y. Ts'o, Jaegeuk Kim,
	Andreas Dilger, Alexander Viro, Christian Brauner, Jan Kara,
	open list:BCACHEFS, open list,
	open list:FSCRYPT: FILE SYSTEM LEVEL ENCRYPTION SUPPORT,
	open list:EXT4 FILE SYSTEM,
	open list:FILESYSTEMS (VFS and infrastructure)
  Cc: willy, Qianfeng Rong

Commit 16f5dfbc851b ("gfp: include __GFP_NOWARN in GFP_NOWAIT")
made GFP_NOWAIT implicitly include __GFP_NOWARN.

Therefore, explicit __GFP_NOWARN combined with GFP_NOWAIT
(e.g., `GFP_NOWAIT | __GFP_NOWARN`) is now redundant. Let's clean
up these redundant flags across subsystems.

No functional changes.

Qianfeng Rong (4):
  bcachefs: Remove redundant __GFP_NOWARN
  fscrypto: Remove redundant __GFP_NOWARN
  ext4: Remove redundant __GFP_NOWARN
  fs-writeback: Remove redundant __GFP_NOWARN

 fs/bcachefs/btree_cache.c        | 4 ++--
 fs/bcachefs/btree_io.c           | 2 +-
 fs/bcachefs/btree_iter.h         | 6 +++---
 fs/bcachefs/btree_trans_commit.c | 2 +-
 fs/bcachefs/fs.c                 | 2 +-
 fs/crypto/bio.c                  | 2 +-
 fs/ext4/page-io.c                | 2 +-
 fs/ext4/super.c                  | 2 +-
 fs/fs-writeback.c                | 2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/4] bcachefs: Remove redundant __GFP_NOWARN
  2025-08-03 10:22 [PATCH 0/4] fs: Remove redundant __GFP_NOWARN Qianfeng Rong
@ 2025-08-03 10:22 ` Qianfeng Rong
  2025-08-03 17:18   ` Kent Overstreet
  2025-08-03 10:22 ` [PATCH 2/4] fscrypto: " Qianfeng Rong
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Qianfeng Rong @ 2025-08-03 10:22 UTC (permalink / raw)
  To: Kent Overstreet, open list:BCACHEFS, open list; +Cc: willy, Qianfeng Rong

GFP_NOWAIT already includes __GFP_NOWARN, so let's remove
the redundant __GFP_NOWARN.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
 fs/bcachefs/btree_cache.c        | 4 ++--
 fs/bcachefs/btree_io.c           | 2 +-
 fs/bcachefs/btree_iter.h         | 6 +++---
 fs/bcachefs/btree_trans_commit.c | 2 +-
 fs/bcachefs/fs.c                 | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/bcachefs/btree_cache.c b/fs/bcachefs/btree_cache.c
index 2f7c384a8c81..3750b297dc76 100644
--- a/fs/bcachefs/btree_cache.c
+++ b/fs/bcachefs/btree_cache.c
@@ -788,7 +788,7 @@ struct btree *bch2_btree_node_mem_alloc(struct btree_trans *trans, bool pcpu_rea
 			goto got_node;
 		}
 
-	b = __btree_node_mem_alloc(c, GFP_NOWAIT|__GFP_NOWARN);
+	b = __btree_node_mem_alloc(c, GFP_NOWAIT);
 	if (b) {
 		bch2_btree_lock_init(&b->c, pcpu_read_locks ? SIX_LOCK_INIT_PCPU : 0, GFP_NOWAIT);
 	} else {
@@ -826,7 +826,7 @@ struct btree *bch2_btree_node_mem_alloc(struct btree_trans *trans, bool pcpu_rea
 
 	mutex_unlock(&bc->lock);
 
-	if (btree_node_data_alloc(c, b, GFP_NOWAIT|__GFP_NOWARN)) {
+	if (btree_node_data_alloc(c, b, GFP_NOWAIT)) {
 		bch2_trans_unlock(trans);
 		if (btree_node_data_alloc(c, b, GFP_KERNEL|__GFP_NOWARN))
 			goto err;
diff --git a/fs/bcachefs/btree_io.c b/fs/bcachefs/btree_io.c
index 8a03cd75a64f..276cf088539e 100644
--- a/fs/bcachefs/btree_io.c
+++ b/fs/bcachefs/btree_io.c
@@ -131,7 +131,7 @@ static void *btree_bounce_alloc(struct bch_fs *c, size_t size,
 	BUG_ON(size > c->opts.btree_node_size);
 
 	*used_mempool = false;
-	p = kvmalloc(size, __GFP_NOWARN|GFP_NOWAIT);
+	p = kvmalloc(size, GFP_NOWAIT);
 	if (!p) {
 		*used_mempool = true;
 		p = mempool_alloc(&c->btree_bounce_pool, GFP_NOFS);
diff --git a/fs/bcachefs/btree_iter.h b/fs/bcachefs/btree_iter.h
index b117cb5d7f94..c8fc6ee01d96 100644
--- a/fs/bcachefs/btree_iter.h
+++ b/fs/bcachefs/btree_iter.h
@@ -954,7 +954,7 @@ struct bkey_s_c bch2_btree_iter_peek_and_restart_outlined(struct btree_iter *);
 
 #define allocate_dropping_locks_errcode(_trans, _do)			\
 ({									\
-	gfp_t _gfp = GFP_NOWAIT|__GFP_NOWARN;				\
+	gfp_t _gfp = GFP_NOWAIT;					\
 	int _ret = _do;							\
 									\
 	if (bch2_err_matches(_ret, ENOMEM)) {				\
@@ -966,7 +966,7 @@ struct bkey_s_c bch2_btree_iter_peek_and_restart_outlined(struct btree_iter *);
 
 #define allocate_dropping_locks(_trans, _ret, _do)			\
 ({									\
-	gfp_t _gfp = GFP_NOWAIT|__GFP_NOWARN;				\
+	gfp_t _gfp = GFP_NOWAIT;					\
 	typeof(_do) _p = _do;						\
 									\
 	_ret = 0;							\
@@ -979,7 +979,7 @@ struct bkey_s_c bch2_btree_iter_peek_and_restart_outlined(struct btree_iter *);
 
 #define allocate_dropping_locks_norelock(_trans, _lock_dropped, _do)	\
 ({									\
-	gfp_t _gfp = GFP_NOWAIT|__GFP_NOWARN;				\
+	gfp_t _gfp = GFP_NOWAIT;					\
 	typeof(_do) _p = _do;						\
 	_lock_dropped = false;						\
 	if (unlikely(!_p)) {						\
diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c
index 8b94a8156fbf..4d58bdb233e9 100644
--- a/fs/bcachefs/btree_trans_commit.c
+++ b/fs/bcachefs/btree_trans_commit.c
@@ -449,7 +449,7 @@ static int btree_key_can_insert_cached(struct btree_trans *trans, unsigned flags
 		return 0;
 
 	new_u64s	= roundup_pow_of_two(u64s);
-	new_k		= krealloc(ck->k, new_u64s * sizeof(u64), GFP_NOWAIT|__GFP_NOWARN);
+	new_k		= krealloc(ck->k, new_u64s * sizeof(u64), GFP_NOWAIT);
 	if (unlikely(!new_k))
 		return btree_key_can_insert_cached_slowpath(trans, flags, path, new_u64s);
 
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index d768a7e7a204..0ff56ccd581a 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -268,7 +268,7 @@ int bch2_inode_or_descendents_is_open(struct btree_trans *trans, struct bpos p)
 		rht_for_each_entry_rcu_from(inode, he, rht_ptr_rcu(bkt), tbl, hash, hash) {
 			if (inode->ei_inum.inum == inum) {
 				ret = darray_push_gfp(&subvols, inode->ei_inum.subvol,
-						      GFP_NOWAIT|__GFP_NOWARN);
+						      GFP_NOWAIT);
 				if (ret) {
 					rcu_read_unlock();
 					ret = darray_make_room(&subvols, 1);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] fscrypto: Remove redundant __GFP_NOWARN
  2025-08-03 10:22 [PATCH 0/4] fs: Remove redundant __GFP_NOWARN Qianfeng Rong
  2025-08-03 10:22 ` [PATCH 1/4] bcachefs: " Qianfeng Rong
@ 2025-08-03 10:22 ` Qianfeng Rong
  2025-08-11 17:31   ` Eric Biggers
  2025-08-03 10:22 ` [PATCH 3/4] ext4: " Qianfeng Rong
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Qianfeng Rong @ 2025-08-03 10:22 UTC (permalink / raw)
  To: Eric Biggers, Theodore Y. Ts'o, Jaegeuk Kim,
	open list:FSCRYPT: FILE SYSTEM LEVEL ENCRYPTION SUPPORT,
	open list
  Cc: willy, Qianfeng Rong

GFP_NOWAIT already includes __GFP_NOWARN, so let's remove
the redundant __GFP_NOWARN.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
 fs/crypto/bio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c
index 486fcb2ecf13..e92967e20e2a 100644
--- a/fs/crypto/bio.c
+++ b/fs/crypto/bio.c
@@ -148,7 +148,7 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
 	 */
 	for (i = 0; i < nr_pages; i++) {
 		pages[i] = fscrypt_alloc_bounce_page(i == 0 ? GFP_NOFS :
-						     GFP_NOWAIT | __GFP_NOWARN);
+						     GFP_NOWAIT);
 		if (!pages[i])
 			break;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] ext4: Remove redundant __GFP_NOWARN
  2025-08-03 10:22 [PATCH 0/4] fs: Remove redundant __GFP_NOWARN Qianfeng Rong
  2025-08-03 10:22 ` [PATCH 1/4] bcachefs: " Qianfeng Rong
  2025-08-03 10:22 ` [PATCH 2/4] fscrypto: " Qianfeng Rong
@ 2025-08-03 10:22 ` Qianfeng Rong
  2025-08-03 10:22 ` [PATCH 4/4] fs-writeback: " Qianfeng Rong
  2025-08-14 14:48 ` [PATCH 0/4] fs: " Theodore Ts'o
  4 siblings, 0 replies; 9+ messages in thread
From: Qianfeng Rong @ 2025-08-03 10:22 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, open list:EXT4 FILE SYSTEM,
	open list
  Cc: willy, Qianfeng Rong

GFP_NOWAIT already includes __GFP_NOWARN, so let's remove
the redundant __GFP_NOWARN.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
 fs/ext4/page-io.c | 2 +-
 fs/ext4/super.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 3d8b0f6d2dea..39abfeec5f36 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -547,7 +547,7 @@ int ext4_bio_write_folio(struct ext4_io_submit *io, struct folio *folio,
 		 * first page of the bio.  Otherwise it can deadlock.
 		 */
 		if (io->io_bio)
-			gfp_flags = GFP_NOWAIT | __GFP_NOWARN;
+			gfp_flags = GFP_NOWAIT;
 	retry_encrypt:
 		bounce_page = fscrypt_encrypt_pagecache_blocks(folio,
 					enc_bytes, 0, gfp_flags);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c7d39da7e733..5f5680336ae6 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -268,7 +268,7 @@ struct buffer_head *ext4_sb_bread_unmovable(struct super_block *sb,
 void ext4_sb_breadahead_unmovable(struct super_block *sb, sector_t block)
 {
 	struct buffer_head *bh = bdev_getblk(sb->s_bdev, block,
-			sb->s_blocksize, GFP_NOWAIT | __GFP_NOWARN);
+			sb->s_blocksize, GFP_NOWAIT);
 
 	if (likely(bh)) {
 		if (trylock_buffer(bh))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] fs-writeback: Remove redundant __GFP_NOWARN
  2025-08-03 10:22 [PATCH 0/4] fs: Remove redundant __GFP_NOWARN Qianfeng Rong
                   ` (2 preceding siblings ...)
  2025-08-03 10:22 ` [PATCH 3/4] ext4: " Qianfeng Rong
@ 2025-08-03 10:22 ` Qianfeng Rong
  2025-08-15 14:06   ` (subset) " Christian Brauner
  2025-08-14 14:48 ` [PATCH 0/4] fs: " Theodore Ts'o
  4 siblings, 1 reply; 9+ messages in thread
From: Qianfeng Rong @ 2025-08-03 10:22 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Jan Kara,
	open list:FILESYSTEMS (VFS and infrastructure), open list
  Cc: willy, Qianfeng Rong

GFP_NOWAIT already includes __GFP_NOWARN, so let's remove
the redundant __GFP_NOWARN.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
 fs/fs-writeback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index cc57367fb641..a3ee79bfb2a4 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1123,7 +1123,7 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id,
 	dirty = dirty * 10 / 8;
 
 	/* issue the writeback work */
-	work = kzalloc(sizeof(*work), GFP_NOWAIT | __GFP_NOWARN);
+	work = kzalloc(sizeof(*work), GFP_NOWAIT);
 	if (work) {
 		work->nr_pages = dirty;
 		work->sync_mode = WB_SYNC_NONE;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] bcachefs: Remove redundant __GFP_NOWARN
  2025-08-03 10:22 ` [PATCH 1/4] bcachefs: " Qianfeng Rong
@ 2025-08-03 17:18   ` Kent Overstreet
  0 siblings, 0 replies; 9+ messages in thread
From: Kent Overstreet @ 2025-08-03 17:18 UTC (permalink / raw)
  To: Qianfeng Rong; +Cc: open list:BCACHEFS, open list, willy

On Sun, Aug 03, 2025 at 06:22:39PM +0800, Qianfeng Rong wrote:
> GFP_NOWAIT already includes __GFP_NOWARN, so let's remove
> the redundant __GFP_NOWARN.
> 
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>

Thanks, applied.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/4] fscrypto: Remove redundant __GFP_NOWARN
  2025-08-03 10:22 ` [PATCH 2/4] fscrypto: " Qianfeng Rong
@ 2025-08-11 17:31   ` Eric Biggers
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Biggers @ 2025-08-11 17:31 UTC (permalink / raw)
  To: Qianfeng Rong
  Cc: Theodore Y. Ts'o, Jaegeuk Kim,
	open list:FSCRYPT: FILE SYSTEM LEVEL ENCRYPTION SUPPORT,
	open list, willy

On Sun, Aug 03, 2025 at 06:22:40PM +0800, Qianfeng Rong wrote:
> GFP_NOWAIT already includes __GFP_NOWARN, so let's remove
> the redundant __GFP_NOWARN.
> 
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> ---
>  fs/crypto/bio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c
> index 486fcb2ecf13..e92967e20e2a 100644
> --- a/fs/crypto/bio.c
> +++ b/fs/crypto/bio.c
> @@ -148,7 +148,7 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
>  	 */
>  	for (i = 0; i < nr_pages; i++) {
>  		pages[i] = fscrypt_alloc_bounce_page(i == 0 ? GFP_NOFS :
> -						     GFP_NOWAIT | __GFP_NOWARN);
> +						     GFP_NOWAIT);
>  		if (!pages[i])
>  			break;
>  	}
> -- 
> 2.34.1
> 

Applied to https://git.kernel.org/pub/scm/fs/fscrypt/linux.git/log/?h=for-next

Thanks!

- Eric

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/4] fs: Remove redundant __GFP_NOWARN
  2025-08-03 10:22 [PATCH 0/4] fs: Remove redundant __GFP_NOWARN Qianfeng Rong
                   ` (3 preceding siblings ...)
  2025-08-03 10:22 ` [PATCH 4/4] fs-writeback: " Qianfeng Rong
@ 2025-08-14 14:48 ` Theodore Ts'o
  4 siblings, 0 replies; 9+ messages in thread
From: Theodore Ts'o @ 2025-08-14 14:48 UTC (permalink / raw)
  To: Ext4 Developers List, Kent Overstreet, Eric Biggers, Jaegeuk Kim,
	Andreas Dilger, Alexander Viro, Christian Brauner, Jan Kara,
	linux-bcachefs, linux-kernel, linux-fscrypt, linux-fsdevel,
	Qianfeng Rong
  Cc: Theodore Ts'o, willy


On Sun, 03 Aug 2025 18:22:38 +0800, Qianfeng Rong wrote:
> Commit 16f5dfbc851b ("gfp: include __GFP_NOWARN in GFP_NOWAIT")
> made GFP_NOWAIT implicitly include __GFP_NOWARN.
> 
> Therefore, explicit __GFP_NOWARN combined with GFP_NOWAIT
> (e.g., `GFP_NOWAIT | __GFP_NOWARN`) is now redundant. Let's clean
> up these redundant flags across subsystems.
> 
> [...]

Applied, thanks!

[3/4] ext4: Remove redundant __GFP_NOWARN
      commit: 4ba97589ed19210ff808929052696f5636139823

Best regards,
-- 
Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: (subset) [PATCH 4/4] fs-writeback: Remove redundant __GFP_NOWARN
  2025-08-03 10:22 ` [PATCH 4/4] fs-writeback: " Qianfeng Rong
@ 2025-08-15 14:06   ` Christian Brauner
  0 siblings, 0 replies; 9+ messages in thread
From: Christian Brauner @ 2025-08-15 14:06 UTC (permalink / raw)
  To: Qianfeng Rong
  Cc: Christian Brauner, willy, Alexander Viro, Jan Kara, linux-fsdevel,
	linux-kernel

On Sun, 03 Aug 2025 18:22:42 +0800, Qianfeng Rong wrote:
> GFP_NOWAIT already includes __GFP_NOWARN, so let's remove
> the redundant __GFP_NOWARN.
> 
> 

Applied to the vfs-6.18.misc branch of the vfs/vfs.git tree.
Patches in the vfs-6.18.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.18.misc

[4/4] fs-writeback: Remove redundant __GFP_NOWARN
      https://git.kernel.org/vfs/vfs/c/15769d9478bd

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-15 14:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-03 10:22 [PATCH 0/4] fs: Remove redundant __GFP_NOWARN Qianfeng Rong
2025-08-03 10:22 ` [PATCH 1/4] bcachefs: " Qianfeng Rong
2025-08-03 17:18   ` Kent Overstreet
2025-08-03 10:22 ` [PATCH 2/4] fscrypto: " Qianfeng Rong
2025-08-11 17:31   ` Eric Biggers
2025-08-03 10:22 ` [PATCH 3/4] ext4: " Qianfeng Rong
2025-08-03 10:22 ` [PATCH 4/4] fs-writeback: " Qianfeng Rong
2025-08-15 14:06   ` (subset) " Christian Brauner
2025-08-14 14:48 ` [PATCH 0/4] fs: " Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).