[PATCH] sched: Remove unused tryget_task_struct()
From: Zhan Xusheng
Date: Tue Jul 07 2026 - 22:30:29 EST
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@xxxxxxxxxx>
---
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