Bug 654293 - sunrpc: need a better way to set tcp_slot_table_entries in RHEL 5
Summary: sunrpc: need a better way to set tcp_slot_table_entries in RHEL 5
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 5.7
Assignee: Harshula Jayasuriya
QA Contact: Jian Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-17 13:34 UTC by Harshula Jayasuriya
Modified: 2018-11-14 16:49 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-07-21 10:19:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
SUNRPC: convert some sysctls into module parameters (2.80 KB, patch)
2010-11-17 14:05 UTC, Harshula Jayasuriya
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1065 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.7 kernel security and bug fix update 2011-07-21 09:21:37 UTC

Description Harshula Jayasuriya 2010-11-17 13:34:04 UTC
Description of problem:

* The sunrpc kernel module exposes the following kernel parameters:
------------------------------------------------------------
/proc/sys/sunrpc/max_resvport
/proc/sys/sunrpc/min_resvport
/proc/sys/sunrpc/tcp_slot_table_entries
/proc/sys/sunrpc/udp_slot_table_entries
------------------------------------------------------------

The sunrpc kernel module is loaded after /etc/sysctl.conf is read. Hence any customisations of the aforementioned kernel parameters are lost by the time the sunrpc kernel modules is loaded.

In RHEL 6, the sunrpc kernel module exposes a set of module parameters that allow the parameters to be customized easily by adding a file to /etc/modprobe.d/ or editing /etc/modprobe.conf. This also has the added benefit of consistently applying the module parameter whenever the module is (re)loaded, unlike some workarounds.

We need to backport to RHEL 5 the following mainline commit:
------------------------------------------------------------
commit cbf1107126af2950623fafdaa5c9df43ab00f046
Author: Trond Myklebust <Trond.Myklebust>
Date:   Sun Aug 9 15:06:19 2009 -0400

    SUNRPC: convert some sysctls into module parameters
    
    Parameters like the minimum reserved port, and the number of slot entries
    should really be module parameters rather than sysctls.
    
    Signed-off-by: Trond Myklebust <Trond.Myklebust>
------------------------------------------------------------

Version-Release number of selected component (if applicable):
* RHEL 5.5
* Kernel 2.6.18-194

How reproducible:
* Always

Regards,
Harshula

Comment 1 Harshula Jayasuriya 2010-11-17 14:05:13 UTC
Created attachment 461072 [details]
SUNRPC: convert some sysctls into module parameters

Comment 3 Dean Hamstead 2010-12-09 00:36:09 UTC
There is a nasty hack to fix this at https://bugzilla.redhat.com/show_bug.cgi?id=189311 

the best way to fix this is either make the processing of sysctl.conf more intelligent.

but a nice and simple way is to have nfs modules load early in the boot process by dropping a script in /etc/sysconfig/modules/

this will avoid touching init scripts all together, and this file can be part of the nfs rpm's - therefore added and removed as needed.

for reference *this method is how kvm kernel modules are loaded in RHEL5 right now*

here is a sample of such a script

/etc/sysconfig/modules/nfs.sh
#!/bin/sh
if [ $(grep -c nfs /etc/fstab) -ne 0 ]; then
modprobe nfs >/dev/null 2>&1
fi

this little script is executed very early in init, before sysctl.conf is loaded. it greps /etc/fstab for nfs entries (granted it will be fooled if you mount /dev/sdXY as /something/nfs for some reason...) and pre-emptively loads nfs (which in turn loads sunrpc). sysctl.conf is loaded thereafter, so the values are applied correctly.

Comment 4 Harshula Jayasuriya 2010-12-09 03:00:38 UTC
(In reply to comment #3)
> but a nice and simple way is to have nfs modules load early in the boot process
> by dropping a script in /etc/sysconfig/modules/

sunrpc is a kernel module where it can be removed and re-added.
Hence we need to utilise a mechanism where the kernel module parameters are applied anytime it is loaded, even well after boot.

Comment 5 RHEL Program Management 2011-02-01 16:55:14 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 10 Jarod Wilson 2011-02-21 20:57:05 UTC
in kernel-2.6.18-245.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 12 Jian Li 2011-05-20 05:36:35 UTC
The bug is tested on 2.6.18-238.12.1.el5 and 2.6.18-262.el5.

1. Feature not implemented:
[root@intel-s3e36-01 ~]# uname -a
Linux intel-s3e36-01.rhts.eng.rdu.redhat.com 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@intel-s3e36-01 ~]# modinfo sunrpc
filename:       /lib/modules/2.6.18-238.12.1.el5/kernel/net/sunrpc/sunrpc.ko
license:        GPL
srcversion:     4C59CA7104F920ED8BF33FD
depends:        
vermagic:       2.6.18-238.12.1.el5 SMP mod_unload gcc-4.1
module_sig:	883f3504dc5e5c12fa8482a4a8d9cf11275a40a0a0f0254efe18ee32e8cf33218b12331dbac89630a0a1c9a22df13ddf2b319f9a839891619a3a5d0fa

2. On 2.6.18-262.el5
[root@hp-dl360g6-01 ~]# uname -a
Linux hp-dl360g6-01.rhts.eng.brq.redhat.com 2.6.18-262.el5 #1 SMP Mon May 16 17:49:03 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@hp-dl360g6-01 ~]# modprobe -r sunrpc
[root@hp-dl360g6-01 ~]# grep sunrpc /etc/modprobe.conf 
options sunrpc  min_resvport=110 max_resvport=11000 tcp_slot_table_entries=11
[root@hp-dl360g6-01 ~]# modprobe sunrpc
[root@hp-dl360g6-01 ~]# cat /proc/sys/sunrpc/{{max,min}_resvport,{tcp,udp}_slot_table_entries}
11000
110
11
16
[root@hp-dl360g6-01 ~]# sysctl -A | grep rpc
sunrpc.max_resvport = 11000
sunrpc.min_resvport = 110
sunrpc.tcp_slot_table_entries = 11
sunrpc.udp_slot_table_entries = 16
====snip

Comment 13 errata-xmlrpc 2011-07-21 10:19:12 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/RHSA-2011-1065.html


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