Re: [PATCH] sched: Document that RT task priorities are 1â99

From: John Ogness
Date: Thu Apr 04 2019 - 03:46:02 EST


On 2019-04-03, John Ogness <john.ogness@xxxxxxxxxxxxx> wrote:
> IMHO it is a bit crazy that userspace RT prio 99 maps to kernel prio
> 0. This leaves a hole at kernel prio 99. Wouldn't it be better just to
> map userspace RT prio 1-99 to kernel prio 99-1?

FWIW, the current mapping:

userspace kernel
--------- ------
rt 1...99 98...0
nice -20...+19 100...139

has been in place since the introduction of Ingo's scalable scheduler:

Author: linus1 <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Sun Dec 16 12:00:00 2001 -0800

v2.5.1.9 -> v2.5.1.10

- Kai Germaschewski: ISDN updates
- Al Viro: start moving buffer cache indexing to "struct
- block_device *"
- Greg KH: USB update
- Russell King: fix up some ARM merge issues
- Ingo Molnar: scalable scheduler

With that commit, the then separate nice and rt_priority task_struct
fields were combined to the new prio field, and thus the mapping was
born.

John Ogness