From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org, willy@infradead.org, linux-mm@kvack.org
Subject: Re: [PATCH 11/12] xfs: clean up remaining GFP_NOFS users
Date: Thu, 18 Jan 2024 16:52:11 -0800 [thread overview]
Message-ID: <20240119005211.GO674499@frogsfrogsfrogs> (raw)
In-Reply-To: <20240115230113.4080105-12-david@fromorbit.com>
On Tue, Jan 16, 2024 at 09:59:49AM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> These few remaining GFP_NOFS callers do not need to use GFP_NOFS at
> all. They are only called from a non-transactional context or cannot
> be accessed from memory reclaim due to other constraints. Hence they
> can just use GFP_KERNEL.
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
Looks good,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> fs/xfs/libxfs/xfs_btree_staging.c | 4 ++--
> fs/xfs/xfs_attr_list.c | 2 +-
> fs/xfs/xfs_buf.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_btree_staging.c b/fs/xfs/libxfs/xfs_btree_staging.c
> index 961f6b898f4b..f0c69f9bb169 100644
> --- a/fs/xfs/libxfs/xfs_btree_staging.c
> +++ b/fs/xfs/libxfs/xfs_btree_staging.c
> @@ -139,7 +139,7 @@ xfs_btree_stage_afakeroot(
> ASSERT(!(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE));
> ASSERT(cur->bc_tp == NULL);
>
> - nops = kmalloc(sizeof(struct xfs_btree_ops), GFP_NOFS | __GFP_NOFAIL);
> + nops = kmalloc(sizeof(struct xfs_btree_ops), GFP_KERNEL | __GFP_NOFAIL);
> memcpy(nops, cur->bc_ops, sizeof(struct xfs_btree_ops));
> nops->alloc_block = xfs_btree_fakeroot_alloc_block;
> nops->free_block = xfs_btree_fakeroot_free_block;
> @@ -220,7 +220,7 @@ xfs_btree_stage_ifakeroot(
> ASSERT(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE);
> ASSERT(cur->bc_tp == NULL);
>
> - nops = kmalloc(sizeof(struct xfs_btree_ops), GFP_NOFS | __GFP_NOFAIL);
> + nops = kmalloc(sizeof(struct xfs_btree_ops), GFP_KERNEL | __GFP_NOFAIL);
> memcpy(nops, cur->bc_ops, sizeof(struct xfs_btree_ops));
> nops->alloc_block = xfs_btree_fakeroot_alloc_block;
> nops->free_block = xfs_btree_fakeroot_free_block;
> diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
> index 0318d768520a..47453510c0ab 100644
> --- a/fs/xfs/xfs_attr_list.c
> +++ b/fs/xfs/xfs_attr_list.c
> @@ -109,7 +109,7 @@ xfs_attr_shortform_list(
> * It didn't all fit, so we have to sort everything on hashval.
> */
> sbsize = sf->count * sizeof(*sbuf);
> - sbp = sbuf = kmalloc(sbsize, GFP_NOFS | __GFP_NOFAIL);
> + sbp = sbuf = kmalloc(sbsize, GFP_KERNEL | __GFP_NOFAIL);
>
> /*
> * Scan the attribute list for the rest of the entries, storing
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index de99368000b4..08f2fbc04db5 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -2008,7 +2008,7 @@ xfs_alloc_buftarg(
> #if defined(CONFIG_FS_DAX) && defined(CONFIG_MEMORY_FAILURE)
> ops = &xfs_dax_holder_operations;
> #endif
> - btp = kzalloc(sizeof(*btp), GFP_NOFS | __GFP_NOFAIL);
> + btp = kzalloc(sizeof(*btp), GFP_KERNEL | __GFP_NOFAIL);
>
> btp->bt_mount = mp;
> btp->bt_bdev_handle = bdev_handle;
> --
> 2.43.0
>
>
next prev parent reply other threads:[~2024-01-19 0:52 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-15 22:59 [PATCH 00/12] xfs: remove remaining kmem interfaces and GFP_NOFS usage Dave Chinner
2024-01-15 22:59 ` [PATCH 01/12] xfs: convert kmem_zalloc() to kzalloc() Dave Chinner
2024-01-18 22:48 ` Darrick J. Wong
2024-01-15 22:59 ` [PATCH 03/12] xfs: move kmem_to_page() Dave Chinner
2024-01-18 22:50 ` Darrick J. Wong
2024-01-15 22:59 ` [PATCH 04/12] xfs: convert kmem_free() for kvmalloc users to kvfree() Dave Chinner
2024-01-18 22:53 ` Darrick J. Wong
2024-01-15 22:59 ` [PATCH 05/12] xfs: convert remaining kmem_free() to kfree() Dave Chinner
2024-01-18 22:54 ` Darrick J. Wong
2024-01-15 22:59 ` [PATCH 06/12] xfs: use an empty transaction for fstrim Dave Chinner
2024-01-18 22:55 ` Darrick J. Wong
2024-01-15 22:59 ` [PATCH 07/12] xfs: use __GFP_NOLOCKDEP instead of GFP_NOFS Dave Chinner
2024-01-18 23:32 ` Darrick J. Wong
2024-06-22 9:44 ` Long Li
2024-07-02 5:55 ` Dave Chinner
2024-07-02 8:00 ` Long Li
2024-01-15 22:59 ` [PATCH 08/12] xfs: use GFP_KERNEL in pure transaction contexts Dave Chinner
2024-01-18 23:38 ` Darrick J. Wong
2024-01-15 22:59 ` [PATCH 09/12] xfs: place intent recovery under NOFS allocation context Dave Chinner
2024-01-18 23:39 ` Darrick J. Wong
2024-01-15 22:59 ` [PATCH 10/12] xfs: place the CIL under nofs " Dave Chinner
2024-01-18 23:41 ` Darrick J. Wong
2024-01-15 22:59 ` [PATCH 11/12] xfs: clean up remaining GFP_NOFS users Dave Chinner
2024-01-19 0:52 ` Darrick J. Wong [this message]
2024-01-15 22:59 ` [PATCH 12/12] xfs: use xfs_defer_alloc a bit more Dave Chinner
2024-01-18 23:41 ` Darrick J. Wong
[not found] ` <20240115230113.4080105-3-david@fromorbit.com>
2024-01-18 22:50 ` [PATCH 02/12] xfs: convert kmem_alloc() to kmalloc() Darrick J. Wong
2024-03-25 17:46 ` [PATCH 00/12] xfs: remove remaining kmem interfaces and GFP_NOFS usage Pankaj Raghav (Samsung)
2024-04-01 21:30 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240119005211.GO674499@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=david@fromorbit.com \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox