Bug 479228 - limits.conf nice value incorrect
Summary: limits.conf nice value incorrect
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: realtime-configuration
Version: 1.0
Hardware: other
OS: All
low
medium
Target Milestone: 1.1.5
: ---
Assignee: Red Hat Real Time Maintenance
QA Contact: David Sommerseth
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-08 07:00 UTC by IBM Bug Proxy
Modified: 2016-05-22 23:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-22 07:52:49 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2009:1170 0 normal SHIPPED_LIVE rt-setup and rt-tests enhancement update 2009-07-22 07:52:42 UTC

Description IBM Bug Proxy 2009-01-08 07:00:29 UTC
=Comment: #0=================================================
Darren V. Hart <dvhltc.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.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.com> - 
Note, this bug also needs to be cloned and mirrored to each of MRG and SLERT.
=Comment: #4=================================================
Darren V. Hart <dvhltc.com> - 
Marking bug as submitted.  When the R2 branch reopens, we'll need to commit this.

Comment 1 IBM Bug Proxy 2009-01-08 07:00:34 UTC
Created attachment 328445 [details]
Correct the nice limits.conf value

Comment 2 IBM Bug Proxy 2009-06-29 13:10:51 UTC
------- Comment From sripathik.com 2009-06-29 09:07 EDT-------
To RH: Have you looked at this bug?

Comment 3 John Kacur 2009-06-29 17:40:39 UTC
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 17:58:59 UTC
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 18:00:46 UTC
------- Comment From dvhltc.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 18:11:42 UTC
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 14:31:04 UTC
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 07:52:49 UTC
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.