Thread (36 messages) 36 messages, 15 authors, 2022-03-27

Re: [RFC PATCH] getvalues(2) prototype

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2022-03-23 07:14:16
Also in: linux-fsdevel, linux-man, linux-security-module, lkml

On Tue, Mar 22, 2022 at 01:36:26PM -0700, Casey Schaufler wrote:
On 3/22/2022 12:27 PM, Miklos Szeredi wrote:
quoted
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 (local)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help