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.
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.
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.