[RFC PATCH 16/16] sched/core: Set activation of non lock-holders to fast-path
From: K Prateek Nayak
Date: Wed Aug 26 2026 - 02:43:57 EST
Tasks with a 0 count in "p->lock_nesting" cannot resolve to a
__mutex_owner(). Set actiavations and blocking of these task to
fast-path (plain __activate_task()) to avoid the overheads.
Signed-off-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>
---
kernel/sched/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3153ad007447..3ab4cd36f887 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2508,7 +2508,7 @@ proxy_activate_blocked_task(struct rq *rq, struct task_struct *p, int en_flags)
static void activate_blocked_task(struct rq *rq, struct task_struct *p, int en_flags)
{
- if (!sched_proxy_exec()) {
+ if (likely(!sched_proxy_exec() || !p->lock_nesting)) {
__activate_task(rq, p, en_flags);
return;
}
@@ -4065,7 +4065,7 @@ static inline void proxy_reset_donor(struct rq *rq)
void __proxy_block_task(struct task_struct *p)
{
- if (!sched_proxy_exec())
+ if (!sched_proxy_exec() || likely(!p->lock_nesting))
return;
if (unlikely(p->is_linked && p->blocked_cpu != task_cpu(p))) {
--
2.34.1