[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86/mm: Add an early PGT_validated exit in _get_page_type()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 22 Jun 2022 11:58:15 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b9XvSjWts0tVBpj71IZMlvk5FpDg77U4Xa8DuTdlaKI=; b=M3XBMTxkvl5yqxt0tD+ck0SJvoTbzkPkh2ZdN8Be+N/KUt6hBOciXOQD/YR7Se/VBqgHKpSh/5iS9HxfpGAFXrHEqIAOPs7zVGlCJt4yMPcEoMk2SewRnzhqqeKXL+7HO8i3rTbTE2bGqrvpQfLo+dK0eqHJExMICe4QGfj4FLLIP76VEKjnvbySAT96uwdhm28+Z8Wk5zGFDhZMqFka372uSyAef2D7mo+Hv6UIZwBZr+OyqRCzuL9RI1aUWpwmPZIWQ2olJafVt5jM7RHqri5GLwakMN/b+8rKhJrqhCOFg83jSi0UXDHgODb9VS9osfUFOPc0XlijjwYxLKYgDA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fB0axncoFDciVTYpHWcBLdQF9c6iN1nR1jq9NzqoQowzqUUd6BPkoQwef61DKfN1qs6jNt9D/p2Iv83AAlPpofwkKXAOom2dvCCzXdo/OJkMgcQ9TGhODO3uAF4B0eSXKWpOinxB4kdSFrqKvoWf2V5v7OCzhpyzhvOgIF8M0jc9N2jSytYI5IXdHLpJU5VJKpeyF1BXYPahD5260sgf2VOKXmpfeKUCsMa22XnX1tZICTuVzX+9JPwD13MfD4Epa44SMscxxOJ0sipjNdJrLQVzl0q1XFSkzs7/bJBZBHvZjnHKQx+4/EuZOejhRTa/alEyq6J7gbWCDEjJuYH+6g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 22 Jun 2022 09:58:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.cooper3@xxxxxxxxxx>

Preferably with the wording above adjusted:
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> 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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.