Linux filesystem development
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Cc: brauner@kernel.org, linux-fsdevel@vger.kernel.org,
	Jan Kara <jack@suse.cz>, Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: super: use GFP_KERNEL instead of GFP_USER for super block allocation
Date: Fri, 8 Dec 2023 18:22:49 +0100	[thread overview]
Message-ID: <20231208172249.3274eh4cjdnwhjch@quack3> (raw)
In-Reply-To: <20231208151022.156273-1-aleksandr.mikhalitsyn@canonical.com>

On Fri 08-12-23 16:10:22, Alexander Mikhalitsyn wrote:
> There is no reason to use a GFP_USER flag for struct super_block allocation
> in the alloc_super(). Instead, let's use GFP_KERNEL for that.
> 
> From the memory management perspective, the only difference between
> GFP_USER and GFP_KERNEL is that GFP_USER allocations are tied to a cpuset,
> while GFP_KERNEL ones are not.
> 
> There is no real issue and this is not a candidate to go to the stable,
> but let's fix it for a consistency sake.
> 
> Cc: Jan Kara <jack@suse.cz>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Christian Brauner <brauner@kernel.org>
> Cc: linux-fsdevel@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>

Yeah, since we allocate other filesystem objects with GFP_KERNEL as well I
agree. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> diff --git a/fs/super.c b/fs/super.c
> index 076392396e72..6fe482371633 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -323,7 +323,7 @@ static void destroy_unused_super(struct super_block *s)
>  static struct super_block *alloc_super(struct file_system_type *type, int flags,
>  				       struct user_namespace *user_ns)
>  {
> -	struct super_block *s = kzalloc(sizeof(struct super_block),  GFP_USER);
> +	struct super_block *s = kzalloc(sizeof(struct super_block), GFP_KERNEL);
>  	static const struct super_operations default_op;
>  	int i;
>  
> -- 
> 2.34.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2023-12-08 17:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 15:10 [PATCH] fs: super: use GFP_KERNEL instead of GFP_USER for super block allocation Alexander Mikhalitsyn
2023-12-08 17:22 ` Jan Kara [this message]
2023-12-08 21:46 ` Christian Brauner

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=20231208172249.3274eh4cjdnwhjch@quack3 \
    --to=jack@suse.cz \
    --cc=aleksandr.mikhalitsyn@canonical.com \
    --cc=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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