linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/4] btrfs: switch GFP_NOFS to GFP_KERNEL in scrub_setup_recheck_block
Date: Thu, 20 Oct 2022 15:27:31 +0800	[thread overview]
Message-ID: <d21439a6-1adf-50ff-c409-b87ef87f54c8@oracle.com> (raw)
In-Reply-To: <aed6063361919c409c72b208d361be0a5d094b3a.1666103172.git.dsterba@suse.com>

On 18/10/2022 22:27, David Sterba wrote:
> There's only one caller that calls scrub_setup_recheck_block in the
> memalloc_nofs_save/_restore protection so it's effectively already
> GFP_NOFS and it's safe to use GFP_KERNEL.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>   fs/btrfs/scrub.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index 9e3b2e60e571..2fc70a2cc7fe 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -1491,7 +1491,7 @@ static int scrub_setup_recheck_block(struct scrub_block *original_sblock,
>   			return -EIO;
>   		}
>   
> -		recover = kzalloc(sizeof(struct scrub_recover), GFP_NOFS);
> +		recover = kzalloc(sizeof(struct scrub_recover), GFP_KERNEL);


I didn't get why GFP_KERNEL is better here, or would it make any 
difference, given that we are already (and rightly) in the 
memalloc_nofs_save() scope.

Thanks, Anand


>   		if (!recover) {
>   			btrfs_put_bioc(bioc);
>   			btrfs_bio_counter_dec(fs_info);
> @@ -1514,7 +1514,7 @@ static int scrub_setup_recheck_block(struct scrub_block *original_sblock,
>   			sblock = sblocks_for_recheck[mirror_index];
>   			sblock->sctx = sctx;
>   
> -			sector = alloc_scrub_sector(sblock, logical, GFP_NOFS);
> +			sector = alloc_scrub_sector(sblock, logical, GFP_KERNEL);
>   			if (!sector) {
>   				spin_lock(&sctx->stat_lock);
>   				sctx->stat.malloc_errors++;


  reply	other threads:[~2022-10-20  7:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 14:27 [PATCH 0/4] Parameter cleanup David Sterba
2022-10-18 14:27 ` [PATCH 1/4] btrfs: sink gfp_t parameter to btrfs_backref_iter_alloc David Sterba
2022-10-20  5:56   ` Anand Jain
2022-10-18 14:27 ` [PATCH 2/4] btrfs: sink gfp_t parameter to btrfs_qgroup_trace_extent David Sterba
2022-10-20  6:01   ` Anand Jain
2022-10-20 16:39     ` David Sterba
2022-10-18 14:27 ` [PATCH 3/4] btrfs: switch GFP_NOFS to GFP_KERNEL in scrub_setup_recheck_block David Sterba
2022-10-20  7:27   ` Anand Jain [this message]
2022-10-20 16:35     ` David Sterba
2022-10-21  2:34       ` Anand Jain
2022-10-18 14:27 ` [PATCH 4/4] btrfs: sink gfp_t parameter to alloc_scrub_sector David Sterba
2022-10-20  7:30   ` Anand Jain
2022-10-19 10:28 ` [PATCH 0/4] Parameter cleanup Johannes Thumshirn
2022-10-19 15:16   ` David Sterba
2022-10-19 15:23     ` Johannes Thumshirn
2022-10-19 16:05       ` David Sterba

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=d21439a6-1adf-50ff-c409-b87ef87f54c8@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).