[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250910151419.3762048-1-kaushlendra.kumar@intel.com>
Date: Wed, 10 Sep 2025 20:44:19 +0530
From: Kaushlendra Kumar <kaushlendra.kumar@...el.com>
To: dave@...olabs.net,
paulmck@...nel.org,
josh@...htriplett.org,
frederic@...nel.org,
neeraj.upadhyay@...nel.org,
rostedt@...dmis.org
Cc: linux-kernel@...r.kernel.org,
rcu@...r.kernel.org,
Kaushlendra Kumar <kaushlendra.kumar@...el.com>
Subject: [PATCH v2] refperf: Remove redundant kfree() after torture_stop_kthread()
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>
---
Changes in v2:
- Corrected commit message based on review feedback
kernel/rcu/refscale.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c
index 2c2648a3ad30..2bfa987f4ba9 100644
--- a/kernel/rcu/refscale.c
+++ b/kernel/rcu/refscale.c
@@ -1050,7 +1050,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.34.1
Powered by blists - more mailing lists