Red Hat Bugzilla – Bug 1289312
ss should only read /proc/slabinfo when required
Last modified: 2016-05-10 20:20:27 EDT
Description of problem:
The `ss` utility is reading /proc/slabinfo every time it is executed
rather than when it actually needs the information.
For the customer system, which is running a low latency application
on the stock rhel6 kernel, this causes delay up around 100ms while
irq processing is blocked while gathering the information on slab
As it appears the the information gathered from /proc/slabinfo
is only used when running ss with the summary option (-s), based
on a suggestion from the customer i've done a patch to move
gathering of slabinfo so that it is only done when the information
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run ss with no options under strace
2. strace data shows /proc/slabinfo is read
/proc/slabinfo is read every time
/proc/slabinfo is only read when the information is required
Created attachment 1103370 [details]
patch to prevent ss reading slabinfo unnecessarily
This upstream commit fixes the behaviour:
Author: Bryton Lee <email@example.com>
Date: Thu Feb 12 14:16:04 2015 +0800
prevent the read ahead of /proc/slabinfo in ss
Signed-off-by: Bryton Lee <firstname.lastname@example.org>
Fix verification is pretty simple using strace as suggested by Stuart:
Here's a test of the faulty version:
# strace -eopen ss 2>&1 | grep slabinfo
open("/proc/slabinfo", O_RDONLY) = 3
With the patch from comment #3 applied, the above command does not produce any output.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.