What is the use of RLIMIT_NICE ?

From: Jeroen Ooms
Date: Tue Jul 31 2012 - 05:51:29 EST


I am using prlimit in Ubuntu to do some resource restrictions in my
sandbox which has been very helpful. However, I am not quite sure what
to do with RLIMIT_NICE. The docs say:

RLIMIT_NICE: Specifies a ceiling to which the process's nice value can
be raised using setpriority(2) or nice(2).

However, according to getpriority(2), a process can raise it's nice
value only if owned by a superuser in the first place. But if this is
the case, the RLIMIT_NICE value is not going to add too any
functionality because a privileged user can arbitrarily lower or
higher RLIMIT values anyway.

So I don't understand how to use or interpret RLIMIT_NICE. For
non-privileged users the entire thing seems useless because they
cannot raise priority in the first place, and it makes no sense to set
it below the current priority. However for superusers it doesn't
really add anything either because thenice, and RLIMIT_NICE soft- and
hard limits can arbitrarily be raised.

So what is the idea behind RLIMIT_NICE ?

Thank you very much,

Jeroen


ps: please cc in reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/