[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Wed, 22 Jun 2022 10:13:52 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=rwNMTYaxCWkAOd/QkHrUWoYX8jFFY1F7nOuXkaZy19g=; b=FRB5FXCW38ZsLsuIl2RcSlU6wbDiffCNvTWHba4TO/5cG9dab/LahKxK8/jTXCk+nvp0MA8mOlMeHiex86epLcVkWgLtLwbGFQi1ifxH/3cPhfKroeJQMiMG07LTOeYv0fzJbDIeFF5CitG7l8BKAaQtdNpG4kdho+WfRtCiuhkJ2gi/Edsvcr/9cFM/pvy5+v9IDQWH/97WKUTKO4WAo38ZKsLhhTJNwTctuTLh+0rTVjbmdLRQIcbBRxZcdDET1jwlMZy9WCoPpLxv+DZHochKcRrjRg/Y96wDbVZFP9+v6FvmiDdbDEQnRDnA/XyhQp73qOXMI6LDsPoAJp//+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IBbhnP1p3zL9n5ICvHDzV2suf7JvsIPeoi1MaBkTIhtujgkDxTnlg5oSL+Z8kacVnNwE4cRXLKt+Y6lnU+5cyIg8qrchOa7jilaZdIVHi6Y8CCl4jOIqvZylWcai2fkG8SFDN1nL59c9Zivs2rxi1pM5RoF6KeOg2ElK1ifF7Y7xQj1Vn9N2ZOUeISF3zf/uTKbW9KrloAmFYw7W7eoE8wJQ/yUWMYC6dcnIcZKMdUUmgatTfuLY2yZhdpGWfZHJx4878f2oB1MrwzwXULPxB5cGFH+IcP1rcygPxwLDNs8zUpI9GDTTN3Y1eN8NyM/0L63HAJ295lC68s0Pj7p8RA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 22 Jun 2022 10:14:05 +0000
  • Ironport-data: A9a23:NbwRYaksEQ1H8a/A2NRzUNvo5gzxJ0RdPkR7XQ2eYbSJt1+Wr1Gzt xIfWmnVaKmLa2T3edlwYYq29EsBvMfSx95jSwo5+Ss3FCMWpZLJC+rCIxarNUt+DCFioGGLT Sk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EgLd9IR2NYy24DnWVnV4 7senuWEULOb828sWo4rw/rrRCNH5JwebxtB4zTSzdgS1LPvvyF94KA3fMldHFOhKmVgJcaoR v6r8V2M1jixEyHBqD+Suu2TnkUiGtY+NOUV45Zcc/DKbhNq/kTe3kunXRa1hIg+ZzihxrhMJ NtxWZOYFSUoZIjhhuImbRR/S3llL6xe4q/KGC3q2SCT5xWun3rE5dxLVB1zEahGv+F9DCdJ6 OASLy0LYlabneWqzbmnS+5qwMM+MM3sO4BZsXZlpd3bJa9+HdafHOOVvpkEhV/chegXdRraT +MfZSBic1LrZBpXN01MIJk/gP2plj/0dDgwRFe9+vFmsjaJnVwZPL7FaduEa9WuGptusFuF+ FDM4kLoJCAUK4nKodaC2jf27gPVpgv5Uo8PELyz9tZxnUaegGcUDXU+Sl+TsfS/zEmkVLp3O 0ESvyYjs6U23EiqVcXmGQ21pmaeuRwRUMYWFPc1gDxh0YLR6gedQ2QBEDhIbYR6sNdsHWBzk FiUg9nuGDpj9qWPTm6Q/auVqjX0PjUJKWgFZmkPSg5tD8TfnbzfRynnFr5LeJNZRPWscd0s6 1hmdBQDuog=
  • Ironport-hdrordr: A9a23:1aiYk6FpJ4nWZhLOpLqFsZLXdLJyesId70hD6qkvc3Fom52j/f xGws5x6fatskdrZJkh8erwW5Vp2RvnhNJICPoqTM2ftW7dySSVxeBZnMbfKljbdxEWmdQtsp uIH5IeNDS0NykDsS+Y2nj3Lz9D+qjgzEnAv463oBlQpENRGthdBmxCe2Sm+zhNNW177O0CZf +hD6R8xwaISDAyVICWF3MFV+/Mq5ngj5T9eyMLABYh9U2nkS6owKSSKWnZ4j4uFxd0hZsy+2 nMlAL0oo+5teug9xPa32jPq7xLhdrazMdZDsDksLlXFtyssHfrWG1SYczHgNkHmpDp1L/sqq iLn/4UBbU315oWRBDtnfKi4Xi57N9k0Q6e9bbRuwqenSW+fkN6NyMJv/MmTvOSgXBQw+1Uwe ZF2XmUuIFQCg6FlCPh58LQXxUvjUasp2E++NRjx0C3fLFuHoO5l7ZvtX+90a1wbh7S+cQiCq 1jHcvc7PFZfReTaG3YpHBmxJipUm4oFhmLT0AesojNugIm1kxR3g8d3ogSj30A/JUyR91N4P nFKL1hkPVLQtUNZaxwCe8dSY+8C3DLQxjLLGWOSG6XX50vKjbIsdr68b817OaldNgBy4Yzgo 3IVBdCuWs7ayvVeLqzNV1wg2TwqUmGLETQI5tllulEU5XHNcnWGDzGTkwymM29pPhaCtHHWp +ISedrP8M=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYgje+Hnf8qY51yESHaKuTNkI+fa1bOL6AgAAEXQA=
  • Thread-topic: [PATCH] x86/mm: Add an early PGT_validated exit in _get_page_type()

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 <andrew.cooper3@xxxxxxxxxx>
> Preferably with the wording above adjusted:
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

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

 


Rackspace

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