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

Re: [PATCH] x86: introduce "hot" and "cold" page copying functions


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Thu, 28 Aug 2025 17:33:50 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=fCcMokIzdxsRGZTu7FFcxph5XHXNPNBe/LWzJ4Nhfa0=; b=LWepDgYVO1ACDa18hM8XT0mTHT4FqMyH5BtIrXQXUCbrDHSZ+xjmrKWkyuMQCSIbgHpSNMrwulk29cLqBayjOPE0hxBcWHhm2SF92hAC4jdFEXXb3Yv9Pk3CFM1k0aohlVpxkHWmtkT1FqhLISgzcIR7hiKt3ci+e7XK7+B2DI1Rw6sXAkVKC7w19mXOu3Hersl0A+nw6TElTcJXtkz6rP6ucMkGPdHh2jKIwIq7qqDS9qjmr3KvXKWHWV8uoTUEArq9LNBiRz/5F7ADRiIsfQ5WOr9sy2nTLNGFbpnyghG8XsLpLmZBhZB4QfFhxeQmWi7kkOG3JAUY7+AfFLqJCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kfho165DUtDBrYB/7VGsuFZlNu37PuerTSPoHIbPXTHwRWB0peMvlC+HZxdSLG3Pj0/1v2mLIaPJEPK+yxf3W2OhGvvq2Vhe+sqJJLJiKNAl8pyAZSTDHF+tR6AK5FJZuI/uIhEJYtY6OAIcw8Z5EK5xIXZqomrEHBfINHMe5wjJUiTU55tAr5cTYe4d4X1OB7q5Eyj3mC0ybB+JqJ2feNOMo+wlO6BpXO5FgnuT5N946kzWYOIO1XBrihn+XLYXiRiHhZ/sOpsdMRK7MKIJlFBsjKZSSMJCnWfNGqFUglQQAqeuWv8eNZ1DpD/h8gUCz1m3u/appf+8HyAxYUD1Mw==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 28 Aug 2025 21:34:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-08-28 05:17, Jan Beulich wrote:
The present copy_page_sse2() is useful in case the destination page isn't
going to get touched again soon, or if we want to limit churn on the
caches. Just rename it, to fit the corresponding {clear,scrub}_page_*()
naming scheme.

For cases where latency is the most important aspect, or when it is
expected that sufficiently large parts of a destination page will get
accessed again soon after the copying, introduce a "hot" alternative.
Again use alternatives patching to select between a "legacy" and an ERMS
variant.

Don't switch any callers just yet - this will be the subject of subsequent
changes.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Jason Andryuk <jason.andryuk@xxxxxxx>

---
Of course both pages can be independently hot/cold, and hence more flavors
may be necessary here.

To avoid the NOP padding (also in clear_page_hot()) we could use a double
REP prefix in the replacement code (accounting for the REX one in the code
being replaced).

Did my tool chain do it automatically?

0000000000000000 <.altinstr_replacement>:
   0:   b9 00 10 00 00          mov    $0x1000,%ecx
   5:   f3 f3 a4                repz rep movsb %ds:(%rsi),%es:(%rdi)

Regards,
Jason



 


Rackspace

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