Thread (117 messages) 117 messages, 14 authors, 2020-03-07

Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17]

flat view

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2020-03-04 16:49:24
Also in: linux-fsdevel, lkml

On Wed, Mar 04, 2020 at 04:22:41PM +0100, Karel Zak wrote:
On Wed, Mar 04, 2020 at 10:01:33AM +0800, Ian Kent wrote:
quoted
On Tue, 2020-03-03 at 14:03 +0100, Greg Kroah-Hartman wrote:
quoted
Actually, I like this idea (the syscall, not just the unlimited
beers).
Maybe this could make a lot of sense, I'll write some actual tests
for
it now that syscalls are getting "heavy" again due to CPU vendors
finally paying the price for their madness...
The problem isn't with open->read->close but with the mount info.
changing between reads (ie. seq file read takes and drops the
needed lock between reads at least once).
readfile() is not reaction to mountinfo. 

The motivation is that we have many places with trivial
open->read->close for very small text files due to /sys and /proc. The
current way how kernel delivers these small strings to userspace seems
pretty inefficient if we can do the same by one syscall.

    Karel

$ strace -e openat,read,close -c ps aux
...
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 43.32    0.004190           4       987           read
 31.42    0.003039           3       844         4 openat
 25.26    0.002443           2       842           close
------ ----------- ----------- --------- --------- ----------------
100.00    0.009672                  2673         4 total

$ strace -e openat,read,close -c lsns
...
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 39.95    0.001567           2       593           openat
 30.93    0.001213           2       597           close
 29.12    0.001142           3       365           read
------ ----------- ----------- --------- --------- ----------------
100.00    0.003922                  1555           total


$ strace -e openat,read,close -c lscpu
...
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 44.67    0.001480           7       189        52 openat
 34.77    0.001152           6       180           read
 20.56    0.000681           4       140           close
------ ----------- ----------- --------- --------- ----------------
100.00    0.003313                   509        52 total
As a "real-world" test, would you recommend me converting one of the
above tools to my implementation of readfile to see how/if it actually
makes sense, or do you have some other tool you would rather see me try?

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