Re: [PATCH v15 08/17] iomap: Pass the iomap_page into iomap_set_range_uptodate

Matthew Wilcox
2021-07-20T11:38:06Z

On Tue, Jul 20, 2021 at 08:57:06AM +0200, Christoph Hellwig wrote:
> On Mon, Jul 19, 2021 at 07:39:52PM +0100, Matthew Wilcox (Oracle) wrote:
> > All but one caller already has the iomap_page, and we can avoid getting
> > it again.
> >
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> > Reviewed-by: Darrick J. Wong <djwong@kernel.org>
>
> In general reloading it from a single pointer should be faster than
> passing an extra argument. What is the rationale here?

I'm not sure we can make that determination in general; it's going to
depend on the number of registers the CPU has, the calling conventions,
how much inlining the compiler chooses to do, etc.

The compiler is actually _forced_ to reload the iop from the page
by the test_bit() in PagePrivate() / folio_test_private(). I want
to kill off that bit, but until I have time to work on that, we
don't have a good workaround.