Skip to contentSkip to conversation

sched: fix outdated comment on task_prio() return value

PATCH New Antoine Busque 1 participant 1 message Nov 29, 2015 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: fix outdated comment on task_prio() return value

The comment describing the possible return values of the task_prio() function, having not been updated in many years, was misleading. It indicated an offset of -200 for RT tasks, and normal tasks having 32 possible priority values centered around 0. This is no longer the case, as the values it returns will be in the range [-100..39]. The new comment reflects the current behaviour.

---
 kernel/sched/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/core.c +2 -2
index bbe9577..b9e5f4a 100644
@@ -3106,8 +3106,8 @@ SYSCALL_DEFINE1(nice, int, increment)
  * @p: the task in question.
  *
  * Return: The priority value as seen by users in /proc.
- * RT tasks are offset by -200. Normal tasks are centered
- * around 0, value goes from -16 to +15.
+ * Values range from -100 to to -2 for RT tasks, and from
+ * 0 to 39 for normal tasks.
  */
 int task_prio(const struct task_struct *p)
 {
Signature · 1 line
2.6.2