[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.02.2101101458420.7366@file01.intranet.prod.int.rdu2.redhat.com>
Date: Sun, 10 Jan 2021 16:19:15 -0500 (EST)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Matthew Wilcox <willy@...radead.org>,
Al Viro <viro@...iv.linux.org.uk>
cc: Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Dave Jiang <dave.jiang@...el.com>,
Ira Weiny <ira.weiny@...el.com>, Jan Kara <jack@...e.cz>,
Steven Whitehouse <swhiteho@...hat.com>,
Eric Sandeen <esandeen@...hat.com>,
Dave Chinner <dchinner@...hat.com>,
"Theodore Ts'o" <tytso@....edu>,
Wang Jianchao <jianchao.wan9@...il.com>,
"Kani, Toshi" <toshi.kani@....com>,
"Norton, Scott J" <scott.norton@....com>,
"Tadakamadla, Rajesh" <rajesh.tadakamadla@....com>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-nvdimm@...ts.01.org
Subject: Re: Expense of read_iter
On Sun, 10 Jan 2021, Matthew Wilcox wrote:
> > That is the reason for that 10% degradation with read_iter.
>
> You seem to be focusing on your argument for "let's just permit
> filesystems to implement both ->read and ->read_iter". My suggestion
> is that we need to optimise the ->read_iter path, but to do that we need
> to know what's expensive.
>
> nvfs_rw_iter_locked() looks very complicated. I suspect it can
> be simplified.
I split it to a separate read and write function and it improved
performance by 1.3%. Using Al Viro's read_iter improves performance by 3%.
> Of course new_sync_read() needs to be improved too,
> as do the other functions here, but fully a third of the difference
> between read() and read_iter() is the difference between nvfs_read()
> and nvfs_rw_iter_locked().
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.
Mikulas
Powered by blists - more mailing lists