[lkml]   [2021]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Expense of read_iter
On Sun, Jan 10, 2021 at 04:19:15PM -0500, Mikulas Patocka wrote:
> I put counters into vfs_read and vfs_readv.
> After a fresh boot of the virtual machine, the counters show "13385 4".
> After a kernel compilation they show "4475220 8".
> So, the readv path is almost unused.
> My reasoning was that we should optimize for the "read" path and glue the
> "readv" path on the top of that. Currently, the kernel is doing the
> opposite - optimizing for "readv" and glueing "read" on the top of it.

But it's not about optimising for read vs readv. read_iter handles
a host of other cases, such as pread(), preadv(), AIO reads, splice,
and reads to in-kernel buffers.

Some device drivers abused read() vs readv() to actually return different
information, depending which you called. That's why there's now a
prohibition against both.

So let's figure out how to make iter_read() perform well for sys_read().

 \ /
  Last update: 2021-01-11 01:19    [W:0.346 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site