[RFC PATCH] getvalues(2) prototype

Greg KH gregkh at linuxfoundation.org
Wed Mar 23 07:14:05 UTC 2022


On Tue, Mar 22, 2022 at 01:36:26PM -0700, Casey Schaufler wrote:
> On 3/22/2022 12:27 PM, Miklos Szeredi wrote:
> > Add a new userspace API that allows getting multiple short values in a
> > single syscall.
> > 
> > This would be useful for the following reasons:
> > 
> > - Calling open/read/close for many small files is inefficient.  E.g. on my
> >    desktop invoking lsof(1) results in ~60k open + read + close calls under
> >    /proc and 90% of those are 128 bytes or less.
> 
> You don't need the generality below to address this issue.
> 
> int openandread(const char *path, char *buffer, size_t size);
> 
> would address this case swimmingly.

Or you can use my readfile(2) proposal:
	https://lore.kernel.org/r/20200704140250.423345-1-gregkh@linuxfoundation.org

But you had better actually benchmark the thing.  Turns out that I could
not find a real-world use that shows improvements in anything.

Miklos, what userspace tool will use this new syscall and how will it be
faster than readfile() was?

I should rebase that against 5.17 again and see if anything is different
due to the new spectre-bhb slowdowns.

thanks,

greg k-h



More information about the Linux-security-module-archive mailing list