[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251213135518.109887-1-qiang.zhang@linux.dev>
Date: Sat, 13 Dec 2025 21:55:18 +0800
From: Zqiang <qiang.zhang@...ux.dev>
To: paulmck@...nel.org,
frederic@...nel.org,
neeraj.upadhyay@...nel.org,
joelagnelf@...dia.com
Cc: rcu@...r.kernel.org,
linux-kernel@...r.kernel.org,
qiang.zhang@...ux.dev
Subject: [PATCH] srcu: Use suitable gfp_flags for the init_srcu_struct_nodes()
In some kernels which is set convert_to_big to SRCU_SIZING_INIT,
for use the init_srcu_struct*() to initialized srcu structure,
the is_static parameters is always false, the memory allocation
for srcu_sup structure's->node can use GFP_KERNEL flags.
Signed-off-by: Zqiang <qiang.zhang@...ux.dev>
---
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..e4571b569752 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_KERNEL : GFP_ATOMIC))
goto err_free_sda;
WRITE_ONCE(ssp->srcu_sup->srcu_size_state, SRCU_SIZE_BIG);
}
--
2.48.1
Powered by blists - more mailing lists