Bug 1473207 - sysctl does not display vm.stat_refresh parameter even if the /proc/sys/vm/stat_refresh file exists
Summary: sysctl does not display vm.stat_refresh parameter even if the /proc/sys/vm/st...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: procps-ng
Version: 26
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Jaromír Cápík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-20 08:38 UTC by Matus Marhefka
Modified: 2017-08-14 15:22 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-08-14 15:22:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Matus Marhefka 2017-07-20 08:38:51 UTC
Description of problem:
When listing all kernel parameters using sysctl, the vm.stat_refresh parameter is not displayed. This is a bug as the /proc/sys/vm/stat_refresh file exists on the filesystem.


Version-Release number of selected component (if applicable):
procps-ng-3.3.10-11.fc24.x86_64
procps-ng-3.3.10-13.fc26.x86_64


How reproducible:
always

Steps to Reproduce:
$ ls -l /proc/sys/vm/stat_refresh
-rw-------. 1 root root 0 Jul 19 15:54 /proc/sys/vm/stat_refresh
$ sysctl -aN 2>/dev/null | grep stat_refresh


Actual results:
`sysctl -aN` output does not list vm.stat_refresh parameter when the /proc/sys/vm/stat_refresh file exists.


Expected results:
`sysctl -aN` output lists vm.stat_refresh parameter when the /proc/sys/vm/stat_refresh file exists.

Comment 1 Roman Žilka 2017-07-20 16:35:37 UTC
Same behavior here. The omission of this particular parameter in the output of sysctl seems to be happening at sysctl.c:282 (ReadSetting(), vanilla procps-ng-3.3.12). Each parameter whose /proc file is empty doesn't get its name printed. And the said file (/proc/sys/vm/stat_refresh) is indeed empty on my system. It is actually the only empty (readable) file under /proc/sys.

I don't know if this is a bug or a feature in sysctl, but from the looks of the code it could be intentional behavior.

Comment 2 Jan Rybar 2017-08-14 15:22:27 UTC
From the documentation in kernel source:
"
stat_refresh

Any read or write (by root only) flushes all the per-cpu vm statistics
into their global totals, for more accurate reports when testing
e.g. cat /proc/sys/vm/stat_refresh /proc/meminfo
"

It seems that this parameter is intentionally blank and for very special purposes we do not want sysctl to trigger. Hence I find it correct not to list this parameter since it is not directly tunable.


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