On 17.06.2022 12:47, Andrew Cooper wrote: > This is a continuation of the cleanup and commenting in: > 9186e96b199e ("x86/pv: Clean up _get_page_type()") > 8cc5036bc385 ("x86/pv: Fix ABAC cmpxchg() race in _get_page_type()") > > With the re-arranged and newly commented logic, it's far more clear that the > second half of _get_page_type() only has work to do for page validation.
To be honest "far more clear" reads misleading to me: Part of the re- arrangement was to move later the early setting of PGT_validated for PGT_writable pages, without which the stated fact wasn't entirely true prior to the re-arrangement. How about s/far more/now/ ? > Introduce an early exit for PGT_validated. This makes the fastpath marginally > faster, and simplifies the subsequent logic as it no longer needs to exclude > the fully validated case. > > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com> Preferably with the wording above adjusted: Reviewed-by: Jan Beulich <jbeul...@suse.com> > Not that it's relevant, but bloat-o-meter says: > > add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-300 (-300) > Function old new delta > _get_page_type 6618 6318 -300 > > which is more impressive than I was expecting. And I have to admit I'm having trouble seeing why that would be. Jan