Re: [PATCH] fs: prefer read_iter over read and write_iter over write

From: Jason A. Donenfeld
Date: Fri May 20 2022 - 17:31:04 EST


Hi David,

On Fri, May 20, 2022 at 09:24:50PM +0000, David Laight wrote:
> From: Jason A. Donenfeld
> > Sent: 20 May 2022 14:51
> >
> > Most kernel code prefers read_iter over read and write_iter over write,
> > yet the read function pointer is tested first. Reverse these so that the
> > iter function is always used first.
>
> There will be a measurable performance hit for the xxx_iter versions.

Indeed. We now have the misfortune of a 3% hit on random.c, per this
sub-thread:

https://lore.kernel.org/lkml/Yoey+FOYO69lS5qP@xxxxxxxxx/

The hope is that it eventually becomes faster... :-\

Jason