By default, non-root users on Linux® cannot raise the priority of a thread
or process. You can change the system configuration to allow priority
changes using the pam_limits module of the Pluggable
Authentication Modules (PAM) for Linux.
sched_setscheduler: Operation not permitted
On recent Linux kernels,
you can change the configuration of the system to allow priority changes
using the pam_limits module. This module allows
you to configure the limits on system resources, which are taken from
the limits configuration file. The default file is /etc/security/limits.conf.
<domain> <type> <item> <value>where:
* - rtprio 100allows all users to change the priority of real-time processes, using chrt or other mechanisms.
By default, the root user can increase real-time priorities
without limits. To apply a limit to root, the root user must be explicitly
specified. Group and wildcard limits in the configuration file do
not apply to the root user.
If you specify individual user limits in the file,
these limits have priority over group limits.
Changes to limits.conf do not take effect immediately. You must restart the affected services or reboot the system for a configuration change to take effect.
The ability to increase the real-time
priority of a Java™ Virtual Machine
(JVM) is not available on Linux kernels
2.6.12 and earlier. The table indicates whether support is available
for this feature in some common Linux distributions.
Linux distribution | Linux kernel version | Support for real-time priority changes (yes/no) |
---|---|---|
Red Hat Enterprise Linux (RHEL) 4 | 2.6.9 | no |
RHEL 5 and later | 2.6.18 and later | yes |
SUSE Linux Enterprise Server (SLES) 9 | 2.6.5-7 | no |
SLES 10 and later | 2.6.16 and later | yes |
Red Hat Enterprise MRG - all versions | 2.6.24 and later | yes |
SUSE Linux Enterprise Real Time (SLERT) - all versions | 2.6.16 and later | yes |
Ubuntu 5.10 | 2.6.12 | no |
Ubuntu 6.06 and later | 2.6.15 and later | yes |
For some examples of using chrt on
a real-time Linux system,
see http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=/liaai/realtime/liaairtchrt.htm .
To enable priority changes on a real-time Linux system you can add a user to the realtime group,
which has an entry in the limits.conf file.