[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250918102952.2593045-10-paulmck@kernel.org>
Date: Thu, 18 Sep 2025 03:29:51 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: rcu@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
kernel-team@...a.com,
rostedt@...dmis.org,
Kaushlendra Kumar <kaushlendra.kumar@...el.com>,
"Paul E . McKenney" <paulmck@...nel.org>
Subject: [PATCH v2 10/11] refperf: Remove redundant kfree() after torture_stop_kthread()
From: Kaushlendra Kumar <kaushlendra.kumar@...el.com>
Remove unnecessary kfree(main_task) call in ref_scale_cleanup() as
torture_stop_kthread() already handles the memory cleanup for the
task structure internally.
The additional kfree(main_task) call after torture_stop_kthread()
is redundant and confusing since torture_stop_kthread() sets the
pointer to NULL, making this a no-op.
This pattern is consistent with other torture test modules where
torture_stop_kthread() is called without explicit kfree() of the
task pointer, as the torture framework manages the task lifecycle
internally.
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@...el.com>
Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
---
kernel/rcu/refscale.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c
index 5840fac06feb7d..7f3d23762ef7c7 100644
--- a/kernel/rcu/refscale.c
+++ b/kernel/rcu/refscale.c
@@ -1135,7 +1135,6 @@ ref_scale_cleanup(void)
kfree(reader_tasks);
torture_stop_kthread("main_task", main_task);
- kfree(main_task);
// Do scale-type-specific cleanup operations.
if (cur_ops->cleanup != NULL)
--
2.40.1
Powered by blists - more mailing lists