Bug 479228 - limits.conf nice value incorrect
limits.conf nice value incorrect
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: realtime-configuration (Show other bugs)
1.0
other All
low Severity medium
: 1.1.5
: ---
Assigned To: Red Hat Real Time Maintenance
David Sommerseth
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-08 02:00 EST by IBM Bug Proxy
Modified: 2016-05-22 19:27 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-07-22 03:52:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Correct the nice limits.conf value (740 bytes, text/plain)
2009-01-08 02:00 EST, IBM Bug Proxy
no flags Details

  None (edit)
Description IBM Bug Proxy 2009-01-08 02:00:29 EST
=Comment: #0=================================================
Darren V. Hart <dvhltc@us.ibm.com> - 
The nice value specified for the realtime group in limits.conf (R2, SLERT) and
limits.d/realtime.conf (MRG) is set to 40, but the range is -19 to 20.  The line should instead read:

@realtime       -       nice            -20

With this change, ulimit properly reports the new privilege:

$ ulimit -e -r
scheduling priority             (-e) 39
real-time priority              (-r) 100

Without it:
$ ulimit -e -r
scheduling priority             (-e) 0
real-time priority              (-r) 100
=Comment: #1=================================================
Darren V. Hart <dvhltc@us.ibm.com> - 

Correct the nice limits.conf value

This patch applies to the R2 build system.  A similar trivial patch would be needed for MRG and
SLERT, although they can probably just make the change directly given the trivial nature of the change.
=Comment: #3=================================================
Darren V. Hart <dvhltc@us.ibm.com> - 
Note, this bug also needs to be cloned and mirrored to each of MRG and SLERT.
=Comment: #4=================================================
Darren V. Hart <dvhltc@us.ibm.com> - 
Marking bug as submitted.  When the R2 branch reopens, we'll need to commit this.
Comment 1 IBM Bug Proxy 2009-01-08 02:00:34 EST
Created attachment 328445 [details]
Correct the nice limits.conf value
Comment 2 IBM Bug Proxy 2009-06-29 09:10:51 EDT
------- Comment From sripathik@in.ibm.com 2009-06-29 09:07 EDT-------
To RH: Have you looked at this bug?
Comment 3 John Kacur 2009-06-29 13:40:39 EDT
Regarding comment 0
The nice range is from -20 to 19 of course.

When you use the getrlimit and setrlimit calls, the nice value is 20 - rlim_cur,
so these calls take rlim_cur values from 1 to 40, which is also what ulimit reports.

Either someone mistakenly thought that limits.conf (or limits.d/realtime.conf) takes the rlim_cur value instead of the nice value, or historically it did work this way. I have tested on a newer machine, and it should be set with the actual nice value so this should be applied to MRG 1.2

I'm waiting for access to an MRG 1.1 machine (or dvhart will test) before saying whether it is applicable there too.
Comment 4 John Kacur 2009-06-29 13:58:59 EDT
Ok, dvhart verified that this should apply to MRG 1.1 too

<dvhart> Per John Kacur's request, here's the results from a RHEL5.2 + MRG 1.1 system:
<dvhart> [root@elm9m101 ~]# uname -r
<dvhart> 2.6.24.7-117.el5rt
<dvhart> [root@elm9m101 ~]# cat /etc/security/limits.d/realtime.conf 
<dvhart> # This file specifies reasonable default limits for users
<dvhart> # who should be able to run realtime processes.
<dvhart> #
<dvhart> # Such users must be added to group 'realtime' to be
<dvhart> # affected by these limits.
<dvhart> @realtime       soft    cpu             unlimited
<dvhart> @realtime       -       rtprio          100
<dvhart> @realtime       -       nice            40
<dvhart> @realtime       -       memlock         unlimited
<dvhart> [root@elm9m101 ~]# su - rtuser
<dvhart> [rtuser@elm9m101 ~]$ groups
<dvhart> rtuser wheel realtime
<dvhart> [rtuser@elm9m101 ~]$ ulimit -e -r
<dvhart> scheduling priority             (-e) 0
<dvhart> real-time priority              (-r) 100
Comment 5 IBM Bug Proxy 2009-06-29 14:00:46 EDT
------- Comment From dvhltc@us.ibm.com 2009-06-29 13:56 EDT-------
Per John Kacur's request, here's the results from a RHEL5.2 + MRG 1.1 system:

[root@elm9m101 ~]# uname -r
2.6.24.7-117.el5rt

[root@elm9m101 ~]# cat /etc/security/limits.d/realtime.conf
# This file specifies reasonable default limits for users
# who should be able to run realtime processes.
#
# Such users must be added to group 'realtime' to be
# affected by these limits.

@realtime       soft    cpu             unlimited
@realtime       -       rtprio          100
@realtime       -       nice            40
@realtime       -       memlock         unlimited

[root@elm9m101 ~]# su - rtuser
[rtuser@elm9m101 ~]$ groups
rtuser wheel realtime

[rtuser@elm9m101 ~]$ ulimit -e -r
scheduling priority             (-e) 0
real-time priority              (-r) 100
Comment 6 John Kacur 2009-06-29 14:11:42 EDT
I applied the following patch

--- devel/realtime.conf 1 Aug 2007 18:25:59 -0000 1.1
+++ devel/realtime.conf 29 Jun 2009 18:05:59 -0000 1.2
@@ -6,5 +6,5 @@

 @realtime       soft    cpu             unlimited
 @realtime       -       rtprio          100
-@realtime       -       nice            40
+@realtime       -       nice            -20
 @realtime       -       memlock         unlimited

to devel/realtime.conf
RHEL-5-RT/realtime.conf
RHEL-5-RT-V1/realtime.conf

for rt-setup in CVS and commited it
Comment 8 David Sommerseth 2009-07-17 10:31:04 EDT
Verified.  Installed current version (rt-setup-1.1-6.el5rt), which had these values in /etc/security/limit.d/realtime.conf:
----------------------------------------------------------------
@realtime       soft    cpu             unlimited
@realtime       -       rtprio          100
@realtime       -       nice            40
@realtime       -       memlock         unlimited
----------------------------------------------------------------

Upgraded to the new version, 1.4-1.el5rt and the new values are:
----------------------------------------------------------------
@realtime       soft    cpu             unlimited
@realtime       -       rtprio          100
@realtime       -       nice            -20
@realtime       -       memlock         unlimited
----------------------------------------------------------------
Comment 10 errata-xmlrpc 2009-07-22 03:52:49 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1170.html

Note You need to log in before you can comment on or make changes to this bug.