From 7f98857ab93447efd103fa69a2e5504fe73a4cbe Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Tue, 20 Sep 2011 18:25:40 +0200 Subject: [PATCH] sched_setscheduler.2: Document 2.6.39 changes to rules governing changes from SCHED_IDLE policy Since Linux 2.6.39, unprivileged processes under the SCHED_IDLE policy can switch to another nonrealtime policy if their nice value falls within the range permitted by their RLIMIT_NICE limit. Signed-off-by: Michael Kerrisk --- man2/sched_setscheduler.2 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/man2/sched_setscheduler.2 b/man2/sched_setscheduler.2 index 3eae33649..863fc50c8 100644 --- a/man2/sched_setscheduler.2 +++ b/man2/sched_setscheduler.2 @@ -44,11 +44,7 @@ .\" .\" Worth looking at: http://rt.wiki.kernel.org/index.php .\" -.\" FIXME: Linux 2.6.39: a thread operating under the SCHED_IDLE policy -.\" is now allowed to upgrade itself to the SCHED_BATCH or SCHED_OTHER -.\" policy if its RLIMIT_NICE resource limit is adequate. -.\" -.TH SCHED_SETSCHEDULER 2 2010-10-04 "Linux" "Linux Programmer's Manual" +.TH SCHED_SETSCHEDULER 2 2011-09-19 "Linux" "Linux Programmer's Manual" .SH NAME sched_setscheduler, sched_getscheduler \- set and get scheduling policy/parameters @@ -358,11 +354,22 @@ as long as the effective user ID of the process making the change matches the real or effective user ID of the target process. .IP * Special rules apply for the -.BR SCHED_IDLE : +.BR SCHED_IDLE . +In Linux kernels before 2.6.39, an unprivileged process operating under this policy cannot change its policy, regardless of the value of its .BR RLIMIT_RTPRIO resource limit. +In Linux kernels since 2.6.39, +.\" commit c02aa73b1d18e43cfd79c2f193b225e84ca497c8 +an unprivileged process can switch to either the +.BR SCHED_BATCH +or the +.BR SCHED_NORMAL +policy so long as its nice value falls within the range permitted by its +.BR RLIMIT_NICE +resource limit (see +.BR getrlimit (2)). .PP Privileged .RB ( CAP_SYS_NICE )