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

[PATCH v2 3/5] x86/mwait-idle: add SnowRidge C-state table


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 20 Jan 2022 15:02:47 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=f4Wc9t+1vhwqA/dFF3ORfoGoLxLZ4aHX6+/gI+XOdLE=; b=E3YyI2S2SaxUtK67tX7kroeS1FSbFb4g9e1hsWOeC/uK3vFFoQluyB0Dl6/mZdWwgVjZgSyngQlfW6iaMdtfNzk89VtnShBuCWIyzElJE09wquMICsUWc4Zc439Xr6GZX4JPwOT/nEfabg+M8VJ6kzXbcPqZnQLg7ErQgY2ahdmGAI9bva+gZTemV44QcqPWZ3MhDNJER597Sxic+WC8hVHSMy+jFrm6Q6YNIR4fDq++fBBhthZGSn7iFi2HxfCoebDXhbHIgLDYpS97Yn+BRKXyzUEA2c7EwtOs+DFkDytPQqZrfuYzKUbksFoqNj5XVvDgUScCsbEb2Xhny0t2+A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mkysnr5Js6PCWKd2z2YvxKt4eRn3J3fOpIBERZUhJE+71+yUD0hirGfR/qFF+j62VBspFJwtMukXm+d+Anfa45YB9/Xu/LdM+MAAt8n9QZya8Uk3Mj2pWwbksVM7R+75davFmxgqO75j8TT2SRqaXkBLDeHmuHv9/rOEcjuRDN1laPvnhCe3eqrxtFZRQ+fVvstysslPfOwc4ZodzM3E5/KEhBMFJurgmbKh0QnVwN0CwwLYNiG8V/gO/MBntysw8SBkvgLNqHRciaWg7E6DgRS73y+j0hpckxCG198ubRXY+CbPRk4PGZyQXz0s9dUbwo/Ui6InM7rQGnv3/fkixw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 20 Jan 2022 14:02:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Artem Bityutskiy <artem.bityutskiy@xxxxxxxxxxxxxxx>

Add C-state table for the SnowRidge SoC which is found on Intel Jacobsville
platforms.

The following has been changed.

 1. C1E latency changed from 10us to 15us. It was measured using the
    open source "wult" tool (the "nic" method, 15us is the 99.99th
    percentile).

 2. C1E power break even changed from 20us to 25us, which may result
    in less C1E residency in some workloads.

 3. C6 latency changed from 50us to 130us. Measured the same way as C1E.

The C6 C-state is supported only by some SnowRidge revisions, so add a C-state
table commentary about this.

On SnowRidge, C6 support is enumerated via the usual mechanism: "mwait" leaf of
the "cpuid" instruction. The 'intel_idle' driver does check this leaf, so even
though C6 is present in the table, the driver will only use it if the CPU does
support it.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@xxxxxxxxxxxxxxx>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
[Linux commit: 9cf93f056f783f986c19f40d5304d1bcffa0fc0d]
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -742,6 +742,32 @@ static const struct cpuidle_state dnv_cs
        {}
 };
 
+/*
+ * Note, depending on HW and FW revision, SnowRidge SoC may or may not support
+ * C6, and this is indicated in the CPUID mwait leaf.
+ */
+static const struct cpuidle_state snr_cstates[] = {
+       {
+               .name = "C1",
+               .flags = MWAIT2flg(0x00),
+               .exit_latency = 2,
+               .target_residency = 2,
+       },
+       {
+               .name = "C1E",
+               .flags = MWAIT2flg(0x01),
+               .exit_latency = 15,
+               .target_residency = 25,
+       },
+       {
+               .name = "C6",
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .exit_latency = 130,
+               .target_residency = 500,
+       },
+       {}
+};
+
 static void mwait_idle(void)
 {
        unsigned int cpu = smp_processor_id();
@@ -954,6 +980,11 @@ static const struct idle_cpu idle_cpu_dn
        .disable_promotion_to_c1e = true,
 };
 
+static const struct idle_cpu idle_cpu_snr = {
+       .state_table = snr_cstates,
+       .disable_promotion_to_c1e = true,
+};
+
 #define ICPU(model, cpu) \
        { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ALWAYS, &idle_cpu_##cpu}
 
@@ -996,7 +1027,7 @@ static const struct x86_cpu_id intel_idl
        ICPU(0x5c, bxt),
        ICPU(0x7a, bxt),
        ICPU(0x5f, dnv),
-       ICPU(0x86, dnv),
+       ICPU(0x86, snr),
        {}
 };
 




 


Rackspace

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