summaryrefslogtreecommitdiff
path: root/kernel/rcu
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 16:37:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 17:09:51 -0800
commitbf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch)
tree01fdd9d27f1b272bef0127966e08eac44d134d0a /kernel/rcu
parente19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff)
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/' to convert the new alloc_obj() users that had a simple GFP_KERNEL argument to just drop that argument. Note that due to the extreme simplicity of the scripting, any slightly more complex cases spread over multiple lines would not be triggered: they definitely exist, but this covers the vast bulk of the cases, and the resulting diff is also then easier to check automatically. For the same reason the 'flex' versions will be done as a separate conversion. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/rcuscale.c6
-rw-r--r--kernel/rcu/rcutorture.c20
-rw-r--r--kernel/rcu/refscale.c4
-rw-r--r--kernel/rcu/srcutree.c2
-rw-r--r--kernel/rcu/update.c2
5 files changed, 17 insertions, 17 deletions
diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c
index 5512686be5d0..6c1acf9ba69b 100644
--- a/kernel/rcu/rcuscale.c
+++ b/kernel/rcu/rcuscale.c
@@ -1130,7 +1130,7 @@ rcu_scale_init(void)
goto unwind;
schedule_timeout_uninterruptible(1);
}
- reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders, GFP_KERNEL);
+ reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders);
if (reader_tasks == NULL) {
SCALEOUT_ERRSTRING("out of memory");
firsterr = -ENOMEM;
@@ -1144,11 +1144,11 @@ rcu_scale_init(void)
}
while (atomic_read(&n_rcu_scale_reader_started) < nrealreaders)
schedule_timeout_uninterruptible(1);
- writer_tasks = kzalloc_objs(writer_tasks[0], nrealwriters, GFP_KERNEL);
+ writer_tasks = kzalloc_objs(writer_tasks[0], nrealwriters);
writer_durations = kcalloc(nrealwriters, sizeof(*writer_durations), GFP_KERNEL);
writer_n_durations = kzalloc_objs(*writer_n_durations, nrealwriters,
GFP_KERNEL);
- writer_done = kzalloc_objs(writer_done[0], nrealwriters, GFP_KERNEL);
+ writer_done = kzalloc_objs(writer_done[0], nrealwriters);
if (gp_async) {
if (gp_async_max <= 0) {
pr_warn("%s: gp_async_max = %d must be greater than zero.\n",
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index d2e673771295..197cea4d1f26 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1626,7 +1626,7 @@ rcu_torture_writer(void *arg)
ulo_size = cur_ops->poll_active;
}
if (cur_ops->poll_active_full > 0) {
- rgo = kzalloc_objs(*rgo, cur_ops->poll_active_full, GFP_KERNEL);
+ rgo = kzalloc_objs(*rgo, cur_ops->poll_active_full);
if (!WARN_ON(!rgo))
rgo_size = cur_ops->poll_active_full;
}
@@ -2558,7 +2558,7 @@ static int rcu_torture_updown_init(void)
VERBOSE_TOROUT_STRING("rcu_torture_updown_init: Disabling up/down reader tests due to lack of primitives");
return 0;
}
- updownreaders = kzalloc_objs(*updownreaders, n_up_down, GFP_KERNEL);
+ updownreaders = kzalloc_objs(*updownreaders, n_up_down);
if (!updownreaders) {
VERBOSE_TOROUT_STRING("rcu_torture_updown_init: Out of memory, disabling up/down reader tests");
return -ENOMEM;
@@ -2891,7 +2891,7 @@ static void rcu_torture_mem_dump_obj(void)
mem_dump_obj(&z);
kmem_cache_free(kcp, rhp);
kmem_cache_destroy(kcp);
- rhp = kmalloc_obj(*rhp, GFP_KERNEL);
+ rhp = kmalloc_obj(*rhp);
if (WARN_ON_ONCE(!rhp))
return;
pr_alert("mem_dump_obj() kmalloc test: rcu_torture_stats = %px, &rhp = %px, rhp = %px\n", stats_task, &rhp, rhp);
@@ -3399,7 +3399,7 @@ static void rcu_torture_fwd_prog_cr(struct rcu_fwd *rfp)
n_launders++;
n_launders_sa++;
} else if (!cur_ops->cbflood_max || cur_ops->cbflood_max > n_max_cbs) {
- rfcp = kmalloc_obj(*rfcp, GFP_KERNEL);
+ rfcp = kmalloc_obj(*rfcp);
if (WARN_ON_ONCE(!rfcp)) {
schedule_timeout_interruptible(1);
continue;
@@ -3587,8 +3587,8 @@ static int __init rcu_torture_fwd_prog_init(void)
fwd_progress_holdoff = 1;
if (fwd_progress_div <= 0)
fwd_progress_div = 4;
- rfp = kzalloc_objs(*rfp, fwd_progress, GFP_KERNEL);
- fwd_prog_tasks = kzalloc_objs(*fwd_prog_tasks, fwd_progress, GFP_KERNEL);
+ rfp = kzalloc_objs(*rfp, fwd_progress);
+ fwd_prog_tasks = kzalloc_objs(*fwd_prog_tasks, fwd_progress);
if (!rfp || !fwd_prog_tasks) {
kfree(rfp);
kfree(fwd_prog_tasks);
@@ -3754,9 +3754,9 @@ static int rcu_torture_barrier_init(void)
atomic_set(&barrier_cbs_count, 0);
atomic_set(&barrier_cbs_invoked, 0);
barrier_cbs_tasks =
- kzalloc_objs(barrier_cbs_tasks[0], n_barrier_cbs, GFP_KERNEL);
+ kzalloc_objs(barrier_cbs_tasks[0], n_barrier_cbs);
barrier_cbs_wq =
- kzalloc_objs(barrier_cbs_wq[0], n_barrier_cbs, GFP_KERNEL);
+ kzalloc_objs(barrier_cbs_wq[0], n_barrier_cbs);
if (barrier_cbs_tasks == NULL || !barrier_cbs_wq)
return -ENOMEM;
for (i = 0; i < n_barrier_cbs; i++) {
@@ -4223,7 +4223,7 @@ static void rcu_test_debug_objects(void)
(!cur_ops->call || !cur_ops->cb_barrier)))
return;
- struct rcu_head *rhp = kmalloc_obj(*rhp, GFP_KERNEL);
+ struct rcu_head *rhp = kmalloc_obj(*rhp);
init_rcu_head_on_stack(&rh1);
init_rcu_head_on_stack(&rh2);
@@ -4562,7 +4562,7 @@ rcu_torture_init(void)
if (torture_init_error(firsterr))
goto unwind;
}
- reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders, GFP_KERNEL);
+ reader_tasks = kzalloc_objs(reader_tasks[0], nrealreaders);
rcu_torture_reader_mbchk = kzalloc_objs(*rcu_torture_reader_mbchk,
nrealreaders, GFP_KERNEL);
if (!reader_tasks || !rcu_torture_reader_mbchk) {
diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c
index 39d679a4c17e..c158b6a947cd 100644
--- a/kernel/rcu/refscale.c
+++ b/kernel/rcu/refscale.c
@@ -1143,7 +1143,7 @@ static bool typesafe_init(void)
else if (si == 0)
si = nr_cpu_ids;
rtsarray_size = si;
- rtsarray = kzalloc_objs(*rtsarray, si, GFP_KERNEL);
+ rtsarray = kzalloc_objs(*rtsarray, si);
if (!rtsarray)
return false;
for (idx = 0; idx < rtsarray_size; idx++) {
@@ -1575,7 +1575,7 @@ ref_scale_init(void)
"%s: nreaders * loops will overflow, adjusted loops to %d",
__func__, INT_MAX / nreaders))
loops = INT_MAX / nreaders;
- reader_tasks = kzalloc_objs(reader_tasks[0], nreaders, GFP_KERNEL);
+ reader_tasks = kzalloc_objs(reader_tasks[0], nreaders);
if (!reader_tasks) {
SCALEOUT_ERRSTRING("out of memory");
firsterr = -ENOMEM;
diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c
index 0faf35f393a3..aef8e91ad33e 100644
--- a/kernel/rcu/srcutree.c
+++ b/kernel/rcu/srcutree.c
@@ -238,7 +238,7 @@ static bool init_srcu_struct_nodes(struct srcu_struct *ssp, gfp_t gfp_flags)
static int init_srcu_struct_fields(struct srcu_struct *ssp, bool is_static)
{
if (!is_static)
- ssp->srcu_sup = kzalloc_obj(*ssp->srcu_sup, GFP_KERNEL);
+ ssp->srcu_sup = kzalloc_obj(*ssp->srcu_sup);
if (!ssp->srcu_sup)
return -ENOMEM;
if (!is_static)
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 14150f09fd61..d98a5c38e19c 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -614,7 +614,7 @@ static void early_boot_test_call_rcu(void)
call_rcu(&head, test_callback);
early_srcu_cookie = start_poll_synchronize_srcu(&early_srcu);
call_srcu(&early_srcu, &shead, test_callback);
- rhp = kmalloc_obj(*rhp, GFP_KERNEL);
+ rhp = kmalloc_obj(*rhp);
if (!WARN_ON_ONCE(!rhp))
kfree_rcu(rhp, rh);
}