public inbox for rcu@vger.kernel.org
 help / color / mirror / Atom feed
From: Joel Fernandes <joelagnelf@nvidia.com>
To: Zqiang <qiang.zhang@linux.dev>,
	paulmck@kernel.org, frederic@kernel.org,
	neeraj.upadhyay@kernel.org
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] srcu: Use suitable gfp_flags for the init_srcu_struct_nodes()
Date: Mon, 22 Dec 2025 19:57:00 -0500	[thread overview]
Message-ID: <5720d304-deaf-439a-be8d-aa6e850f22a2@nvidia.com> (raw)
In-Reply-To: <20251214101433.126434-1-qiang.zhang@linux.dev>

On 12/14/2025 5:14 AM, Zqiang wrote:
> For use the init_srcu_struct*() to initialized srcu structure,
> the srcu structure's->srcu_sup and sda use GFP_KERNEL flags to
> allocate memory. similarly, if set SRCU_SIZING_INIT, the
> srcu_sup's->node can still use GFP_KERNEL flags to allocate
> memory, not need to use GFP_ATOMIC flags all the time.
> 
> Signed-off-by: Zqiang <qiang.zhang@linux.dev>

Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>

Will apply and send out to the list (soon) with other patches for further review
and testing.

 - Joel

> ---
>  kernel/rcu/srcutree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
> index ea3f128de06f..c469c708fdd6 100644
> --- a/kernel/rcu/srcutree.c
> +++ b/kernel/rcu/srcutree.c
> @@ -262,7 +262,7 @@ static int init_srcu_struct_fields(struct srcu_struct *ssp, bool is_static)
>  	ssp->srcu_sup->srcu_gp_seq_needed_exp = SRCU_GP_SEQ_INITIAL_VAL;
>  	ssp->srcu_sup->srcu_last_gp_end = ktime_get_mono_fast_ns();
>  	if (READ_ONCE(ssp->srcu_sup->srcu_size_state) == SRCU_SIZE_SMALL && SRCU_SIZING_IS_INIT()) {
> -		if (!init_srcu_struct_nodes(ssp, GFP_ATOMIC))
> +		if (!init_srcu_struct_nodes(ssp, is_static ? GFP_ATOMIC : GFP_KERNEL))
>  			goto err_free_sda;
>  		WRITE_ONCE(ssp->srcu_sup->srcu_size_state, SRCU_SIZE_BIG);
>  	}


      reply	other threads:[~2025-12-23  0:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-14 10:14 [PATCH v2] srcu: Use suitable gfp_flags for the init_srcu_struct_nodes() Zqiang
2025-12-23  0:57 ` Joel Fernandes [this message]

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=5720d304-deaf-439a-be8d-aa6e850f22a2@nvidia.com \
    --to=joelagnelf@nvidia.com \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neeraj.upadhyay@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=qiang.zhang@linux.dev \
    --cc=rcu@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