* [PATCH] sched/core: Fix prio for fair in __task_prio
@ 2024-01-29 10:06 Wang Jinchao
0 siblings, 0 replies; 2+ messages in thread
From: Wang Jinchao @ 2024-01-29 10:06 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
Daniel Bristot de Oliveira, Valentin Schneider, linux-kernel
Cc: stone.xulei, wangjinchao
It is said "120" in the comment, but MAX_RT_PRIO + MAX_NICE equals 119.
DEFAULT_PRIO should be the right prio.
Fix it and imodify the corresponding prio in prio_less.
Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
---
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 9116bcc90346..13484ee71e5b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -168,7 +168,7 @@ static inline int __task_prio(const struct task_struct *p)
if (p->sched_class == &idle_sched_class)
return MAX_RT_PRIO + NICE_WIDTH; /* 140 */
- return MAX_RT_PRIO + MAX_NICE; /* 120, squash fair */
+ return DEFAULT_PRIO; /* 120, squash fair */
}
/*
@@ -194,7 +194,7 @@ static inline bool prio_less(const struct task_struct *a,
if (pa == -1) /* dl_prio() doesn't work because of stop_class above */
return !dl_time_before(a->dl.deadline, b->dl.deadline);
- if (pa == MAX_RT_PRIO + MAX_NICE) /* fair */
+ if (pa == DEFAULT_PRIO) /* fair */
return cfs_prio_less(a, b, in_fi);
return false;
--
2.40.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] sched/core: Fix prio for fair in __task_prio
@ 2024-01-29 10:19 Wang Jinchao
0 siblings, 0 replies; 2+ messages in thread
From: Wang Jinchao @ 2024-01-29 10:19 UTC (permalink / raw)
To: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
Daniel Bristot de Oliveira, Valentin Schneider, linux-kernel
Cc: stone.xulei, wangjinchao
It is said "120" in the comment, but MAX_RT_PRIO + MAX_NICE equals 119.
DEFAULT_PRIO should be the right prio.
Fix it and imodify the corresponding prio in prio_less.
Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
---
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 9116bcc90346..13484ee71e5b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -168,7 +168,7 @@ static inline int __task_prio(const struct task_struct *p)
if (p->sched_class == &idle_sched_class)
return MAX_RT_PRIO + NICE_WIDTH; /* 140 */
- return MAX_RT_PRIO + MAX_NICE; /* 120, squash fair */
+ return DEFAULT_PRIO; /* 120, squash fair */
}
/*
@@ -194,7 +194,7 @@ static inline bool prio_less(const struct task_struct *a,
if (pa == -1) /* dl_prio() doesn't work because of stop_class above */
return !dl_time_before(a->dl.deadline, b->dl.deadline);
- if (pa == MAX_RT_PRIO + MAX_NICE) /* fair */
+ if (pa == DEFAULT_PRIO) /* fair */
return cfs_prio_less(a, b, in_fi);
return false;
--
2.40.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-01-29 10:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-29 10:06 [PATCH] sched/core: Fix prio for fair in __task_prio Wang Jinchao
2024-01-29 10:19 Wang Jinchao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).