* [PATCH] sched: Remove unused tryget_task_struct()
@ 2026-07-08 2:30 Zhan Xusheng
2026-07-08 2:43 ` Tejun Heo
2026-07-08 14:26 ` Oleg Nesterov
0 siblings, 2 replies; 3+ messages in thread
From: Zhan Xusheng @ 2026-07-08 2:30 UTC (permalink / raw)
To: Peter Zijlstra, Andrew Morton
Cc: Tejun Heo, Oleg Nesterov, Ingo Molnar, linux-kernel, Zhan Xusheng
tryget_task_struct() was added for sched_ext by commit a8532fac7b5d
("sched_ext: TASK_DEAD tasks must be switched into SCX on ops_enable").
All of its users in sched_ext were subsequently converted to
get_task_struct() by commit fbe3fb103596 ("sched_ext: Replace
tryget_task_struct() with get_task_struct()"), leaving the helper with
no callers.
Remove the now-unused helper. No functional change.
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
include/linux/sched/task.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h
index 41ed884cffc9..1788bee1e39c 100644
--- a/include/linux/sched/task.h
+++ b/include/linux/sched/task.h
@@ -117,11 +117,6 @@ static inline struct task_struct *get_task_struct(struct task_struct *t)
return t;
}
-static inline struct task_struct *tryget_task_struct(struct task_struct *t)
-{
- return refcount_inc_not_zero(&t->usage) ? t : NULL;
-}
-
extern void __put_task_struct(struct task_struct *t);
extern void __put_task_struct_rcu_cb(struct rcu_head *rhp);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] sched: Remove unused tryget_task_struct()
2026-07-08 2:30 [PATCH] sched: Remove unused tryget_task_struct() Zhan Xusheng
@ 2026-07-08 2:43 ` Tejun Heo
2026-07-08 14:26 ` Oleg Nesterov
1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2026-07-08 2:43 UTC (permalink / raw)
To: Zhan Xusheng
Cc: Peter Zijlstra, Andrew Morton, Oleg Nesterov, Ingo Molnar,
linux-kernel, Zhan Xusheng
On Wed, Jul 08, 2026 at 10:30:11AM +0800, Zhan Xusheng wrote:
> tryget_task_struct() was added for sched_ext by commit a8532fac7b5d
> ("sched_ext: TASK_DEAD tasks must be switched into SCX on ops_enable").
> All of its users in sched_ext were subsequently converted to
> get_task_struct() by commit fbe3fb103596 ("sched_ext: Replace
> tryget_task_struct() with get_task_struct()"), leaving the helper with
> no callers.
>
> Remove the now-unused helper. No functional change.
>
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] sched: Remove unused tryget_task_struct()
2026-07-08 2:30 [PATCH] sched: Remove unused tryget_task_struct() Zhan Xusheng
2026-07-08 2:43 ` Tejun Heo
@ 2026-07-08 14:26 ` Oleg Nesterov
1 sibling, 0 replies; 3+ messages in thread
From: Oleg Nesterov @ 2026-07-08 14:26 UTC (permalink / raw)
To: Zhan Xusheng
Cc: Peter Zijlstra, Andrew Morton, Tejun Heo, Ingo Molnar,
linux-kernel, Zhan Xusheng
On 07/08, Zhan Xusheng wrote:
>
> tryget_task_struct() was added for sched_ext by commit a8532fac7b5d
> ("sched_ext: TASK_DEAD tasks must be switched into SCX on ops_enable").
> All of its users in sched_ext were subsequently converted to
> get_task_struct() by commit fbe3fb103596 ("sched_ext: Replace
> tryget_task_struct() with get_task_struct()"), leaving the helper with
> no callers.
>
> Remove the now-unused helper. No functional change.
>
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-08 14:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 2:30 [PATCH] sched: Remove unused tryget_task_struct() Zhan Xusheng
2026-07-08 2:43 ` Tejun Heo
2026-07-08 14:26 ` Oleg Nesterov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox