All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: svt-core@virtuozzo.com
Cc: andrey.drobyshev@virtuozzo.com, den@openvz.org
Subject: [PATCH hci-8.1 1/2] i386: turn off x-consistent-cache on pc-q35-vz10.1.0 #VSTOR-154986
Date: Mon, 16 Nov 2026 18:50:01 +0100	[thread overview]
Message-ID: <20261116175002.844361-2-den@openvz.org> (raw)
In-Reply-To: <20261116175002.844361-1-den@openvz.org>

From: Denis V. Lunev <den@openvz.org>

pc-q35-vz10.1.0 is based on rhel10.2.0 and so takes the upstream default
of x-consistent-cache from 6699e5dc864 ("i386/cpu: Present same cache
model in CPUID 0x2 & 0x4"). CPUID leaf 2 then reports 0xff, "use leaf
4", instead of legacy descriptors. glibc reads leaf 2 for each of its
cache queries at every process start, and with 0xff each read walks the
leaf 4 subleaves. Under KVM every CPUID is a VM exit, so a vz10.1.0
guest takes many more CPUID exits per exec than a vz10.0.0 one, and
fork/exec heavy workloads (unixbench execl, spawn and shell) regress.

Neither cache model describes the host, both are synthetic, so the new
one buys the guest nothing. Turn it off as vz10.0.0 and rhel10.0.0 do.

The guest reads leaf 2 at boot and glibc at process start, so a running
vz10.1.0 guest migrated to a node with this change keeps working, new
processes just see the old descriptors.

Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 hw/i386/pc.c         | 5 +++++
 hw/i386/pc_q35.c     | 2 +-
 include/hw/i386/pc.h | 3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 2834982dab4..8b39c5621c6 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -548,6 +548,11 @@ GlobalProperty pc_vz_compat[] = {
 };
 const size_t pc_vz_compat_len = G_N_ELEMENTS(pc_vz_compat);
 
+GlobalProperty pc_vz_10_1_compat[] = {
+    { TYPE_X86_CPU, "x-consistent-cache", "false" },
+};
+const size_t pc_vz_10_1_compat_len = G_N_ELEMENTS(pc_vz_10_1_compat);
+
 GlobalProperty pc_vz_10_0_compat[] = {
     { TYPE_X86_CPU, "x-no-la57-on-start", "on" },
 };
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 51539f22399..ae8298e0503 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -972,7 +972,7 @@ DEFINE_Q35_RHEL_MACHINE(7, 3, 0);
 
 /*  maj min mic         basemt      isdefault                              */
 #define VZ_Q35_MT(X)                                                        \
-    X(10, 1, 0, MT_VER_SYM(10, 2, 0), true)                                 \
+    X(10, 1, 0, MT_VER_SYM(10, 2, 0), true,  pc_vz_10_1_compat)             \
     X(10, 0, 0, MT_VER_SYM(10, 0, 0), false, pc_vz_10_0_compat)             \
     X(9, 2,  0, MT_VER_SYM(9, 6, 0),  false, pc_vz_9_2_compat)              \
     X(9, 1,  0, MT_VER_SYM(9, 4, 0),  false, hw_compat_vz_9_1)              \
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 021b139b872..276d0cdb3fa 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -364,6 +364,9 @@ extern const size_t pc_rhel_7_2_compat_len;
 extern GlobalProperty pc_vz_compat[];
 extern const size_t pc_vz_compat_len;
 
+extern GlobalProperty pc_vz_10_1_compat[];
+extern const size_t pc_vz_10_1_compat_len;
+
 extern GlobalProperty pc_vz_10_0_compat[];
 extern const size_t pc_vz_10_0_compat_len;
 
-- 
2.55.0


  reply	other threads:[~2026-11-16 17:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 17:50 [PATCH hci-8.1 0/2] i386: fix the exec slowdown of pc-q35-vz10.1.0 guests #VSTOR-154986 Denis V. Lunev
2026-11-16 17:50 ` Denis V. Lunev [this message]
2026-11-16 17:53   ` [PATCH hci-8.1 1/2] i386: turn off x-consistent-cache on pc-q35-vz10.1.0 #VSTOR-154986 no-reply
2026-11-17 17:03   ` Andrey Drobyshev
2026-11-16 17:50 ` [PATCH hci-8.1 2/2] i386: hide la57 at fresh start on pc-q35-vz10.1.0 too #VSTOR-154986 Denis V. Lunev
2026-11-16 17:53   ` no-reply
2026-11-17 17:03   ` Andrey Drobyshev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116175002.844361-2-den@openvz.org \
    --to=den@openvz.org \
    --cc=andrey.drobyshev@virtuozzo.com \
    --cc=svt-core@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.