lkml.org 
[lkml]   [2022]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] getvalues(2) prototype
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

\
 
 \ /
  Last update: 2022-03-23 08:14    [W:0.504 / U:2.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site