On Fri, Nov 20, 2020 at 06:20:06PM +0000, Christopher Lameter wrote: > On Tue, 17 Nov 2020, Marcelo Tosatti wrote: > > > > So what we would need would be something like a sysctl that puts the > > > system into a quiet state by completing all workqueue items. Idle all > > > subsystems that need it and put the cpu into NOHZ mode. > > > > Are you suggesting that instead of a specific file to control vmstat > > workqueue only, a more generic sysctl could be used? > > Yes. Introduce a sysctl to quiet down the system. Clean caches that will > trigger kernel threads and whatever else is pending on that processor. OK, makes sense. About sysctl, in particular: NOTES top Use of this system call was long discouraged: since Linux 2.6.24, uses of this system call result in warnings in the kernel log, and in Linux 5.5, the system call was finally removed. Use the /proc/sys interface instead. Note that on older kernels where this system call still exists, it is available only if the kernel was configured with the CONFIG_SYSCTL_SYSCALL option. Furthermore, glibc does not provide a wrapper for this system call, necessitating the use of syscall(2). So will stick to the /proc/ suggestion. > > About NOHZ mode: the CPU should enter NOHZ automatically as soon as > > there is a single thread running, so unclear why that would be needed. > > There are typically pending actions that still trigger interruptions. > > If you would immediately quiet down the system if there is only one thread > runnable then you would compromise system performance through frequent > counter folding and cache cleaning etc. Makes sense.