$RodHat_/search
resource limits reference

RLIMIT_NICE

Ceiling for how far the process may raise its own priority with nice or setpriority.

Resource number
13
Row in /proc/PID/limits
Max nice priority
bash ulimit flag
ulimit -e
Unit in /proc/PID/limits
priority (see note)
Added in Linux
2.6.12
Group
CPU time and scheduling

What happens at the limit

Lowering the nice value fails: setpriority(2) returns EACCES and nice(2) returns EPERM.

The value is not a nice number. The kernel computes the lowest allowed nice value as 20 minus the limit, so a limit of 40 allows down to nice -20, a limit of 25 allows down to -5, and the usual 0 lets a process only raise its own nice value. That is why /proc/PID/limits shows a "Max nice priority" of 0 for ordinary users.

Check a running process with grep -i "Max nice priority" /proc/PID/limits, or paste the whole file into the limits reader. Inspect or change one on a live process with prlimit --pid PID(util-linux).

Sources

  1. getrlimit(2), Linux man-pages
  2. proc_pid_limits(5), Linux man-pages

Resource numbers are from asm-generic/resource.h; a few architectures (Alpha, MIPS, SPARC) number some limits differently. The list of syscall cards is matched by name from the card text on this site, not from the kernel source. Spot one that's wrong? Tell Rod.