On Mon, 10 Aug 2020 17:04:53 +0200 Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote: > How many syscalls does this save on? > > Perhaps you want my proposed readfile(2) syscall: > https://lore.kernel.org/r/20200704140250.423345-1-gregkh@xxxxxxxxxxxxxxxxxxx > to help out with things like this? :) The proposed readfile sounds great and would help, but if there are 1000 processes wouldn't that require 1000 readfile calls to read their proc files? With something like this the stats for 1000 processes could be retrieved with an open, a few reads and a close. > > > The proposed files in this proof-of-concept patch set are: > > > > * /proc/all/stat > > I think the problem will be defining "all" in the case of the specific > namespace you are dealing with, right? How will this handle all of > those issues properly for all of these different statisics? > Currently I'm trying to re-use the existing code in fs/proc that controls which PIDs are visible, but may well be missing something.. Best Wishes, Eugene