sched/deadline: Do not start hrtick if its disabled for DL
PATCH 1/1 sched/deadline: Do not start hrtick if its disabled for DL
Fix an issue where high-resolution timers causes aggressive preemptions, leading to increased idle times in CFS tasks (which are inside the DL server). The problem was traced to improper usage of hrtick_enabled(), which could start high-resolution ticks unexpectedly causing repeated preemptions.
The fix replaces this call with hrtick_enabled_dl(), aligning it with scheduler feature checks.
--- kernel/sched/deadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +1 -1
@@ -2121,7 +2121,7 @@ static struct task_struct *pick_next_task_dl(struct rq *rq)if (!p->dl_server)set_next_task_dl (rq, p, true); -if (hrtick_enabled (rq)) +if (hrtick_enabled_dl (rq))start_hrtick_dl (rq, &p->dl);return p;
Signature · 1 line
2.47.0.277.g8800431eea-goog
Juri Lelli
maintainerHi Joel,
Quoted 22 lines · Joel Fernandes (Google)
Fix an issue where high-resolution timers causes aggressive preemptions, leading to increased idle times in CFS tasks (which are inside the DL server). The problem was traced to improper usage of
hrtick_enabled(), which could start high-resolution ticks unexpectedly causing repeated preemptions.The fix replaces this call with
hrtick_enabled_dl(), aligning it with scheduler feature checks.Reported-by Aashish Sharma <[email protected]>Reported-by Vineeth Pillai <[email protected]>Signed-off-by Joel Fernandes (Google) <[email protected]>--- kernel/sched/deadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/sched/deadline.c +0
-0
kernel/sched/deadline.c static struct task_struct *pick_next_task_dl(struct rq *rq) · line 2127
Quoted 8 lines
kernel/sched/deadline.c +1
-1@@ -2121,7 +2121,7 @@ static struct task_struct *pick_next_task_dl(struct rq *rq)if (!p->dl_server)set_next_task_dl (rq, p, true); -if (hrtick_enabled (rq)) +if (hrtick_enabled_dl (rq))start_hrtick_dl (rq, &p->dl);return p;
I'm not sure I'm seeing this in current code. We have two users in deadline.c and they both use hrtick_enabled_dl (after a recent fix by Phil).
Best,
Juri
Quoted 31 lines · Juri Lelli
Hi Joel,
Quoted 28 lines · Joel Fernandes (Google)
Fix an issue where high-resolution timers causes aggressive preemptions, leading to increased idle times in CFS tasks (which are inside the DL server). The problem was traced to improper usage of
hrtick_enabled(), which could start high-resolution ticks unexpectedly causing repeated preemptions.The fix replaces this call with
hrtick_enabled_dl(), aligning it with scheduler feature checks.Reported-by Aashish Sharma <[email protected]>Reported-by Vineeth Pillai <[email protected]>Signed-off-by Joel Fernandes (Google) <[email protected]>--- kernel/sched/deadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/sched/deadline.c +1
-1@@ -2121,7 +2121,7 @@ static struct task_struct *pick_next_task_dl(struct rq *rq)if (!p->dl_server)set_next_task_dl (rq, p, true); -if (hrtick_enabled (rq)) +if (hrtick_enabled_dl (rq))start_hrtick_dl (rq, &p->dl);
Quoted 6 lines
kernel/sched/deadline.c static struct task_struct *pick_next_task_dl(struct rq *rq) · line 2127
Quoted 2 lines
kernel/sched/deadline.c +0
-0return p;I'm not sure I'm seeing this in current code. We have two users in
deadline.cand they both usehrtick_enabled_dl(after a recent fix by Phil).
Ah you're right. The latest kernel we are on is on 6.6 so this got missed.
Thanks Juri for your quick reply and pointing out the missing patches!
- Joel