On 22/06/2022 10:58, Jan Beulich wrote:
> 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 <[email protected]>
> Preferably with the wording above adjusted:
> Reviewed-by: Jan Beulich <[email protected]>

Ok.

>> 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.

I was surprised too, but it's deterministic with GCC 11.  I initially
disbelieved it and did full clean rebuilds.

validate_page() is fully inlined, and there were a reasonable number of
jmp.d32 -> jmp.d8 changes, but I very much doubt there are 75 of them. 
I can only assume there's a reasonable chunk of logic which succumbs to DCE.

~Andrew

Reply via email to