Re: [RFC PATCH 0/2] mm/gup: fix gup_fast with dynamic page table folding
From: Jason Gunthorpe
Date: Wed Sep 02 2020 - 16:14:02 EST
On Wed, Sep 02, 2020 at 05:09:58PM +0200, Gerald Schaefer wrote:
> I guess we *could* assume that all the extra pXd_offset() calls and
> also the de-referencing would be optimized out by the compiler for other
> archs, but it is one example where my gut tells me that this might not
> be so trivial and w/o unwanted effects after all.
Assigning to a variable that is never read should be eliminated.. If
things are very complex then the pXX_offset function might need to be
marked with attribute pure, but I think this should be reliable?
Jason