[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC v2 5/5] x86/mwait-idle: squash stats update when not actually entering C-state
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 20 Jan 2022 15:05:12 +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=Ki88Bt745Kcm6s6wmFvsK/mpmFMQIsi3fvdnsTbkCRg=; b=EOCJhFgg2rW6AkWMHGepmDM2SDmuUSGpShByA78TBO2ByoDPWISzDz4MW2BBIgLal1+PWY4h7gsWHTbxF+9CcTd4mC5LzK1L0L6nHRAo8Wk2J5wTyfOYMAxnyD1fmfGHpuYT2Jvf8ApkEePqXnkxlP0cBI/D2phea7EKYEEcRe78ibZIV458YAHOqRpyS1IWA26M9/IPDt16z3Ff1ZxINKXf295bwUlc/6QgkvDDxrEdSDr5N1dBQRY3v7Df64etjumMozwop06TNZB7V8rUKToSKn5NpABIOmIFaZuN65CUjHzp85UAxG4MmloVodYy0MyKLel/IVytz7QC0vdRVQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HILrtr//VkJcVq2upy2lyOAv+/g4fS+ydQ8UvgpnXIUwDbaTb5290o0iBQ2l69v1NCl/4ejW9+3ZKOjMdo5EDm6IvPOuWJw10XjGd16yNPS60HFyhONlWDsUGkT/yEOJApqdVoXO+NEIUavqyl6Kz3uV7HNG9BEcFmJB9t+cXKp+485Tua61yTTo8tFa/saw1cQLm69HXlwKb36BSLd9Cvm6ZbERpTfmoI1sxeD6PlCsIBokzaFiXoCExS6MsMaOoIcW9q/GAJkBMp/nFJzmnbum7kbKVzs2VcQtyOs0Mo8QNPHJgP2/43TKBUYnulOYMO51ju+byfhaZtOUZ9OgKg==
- 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:05:19 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
While we don't want to skip calling update_idle_stats(), arrange for it
to not increment the overall time spent in the state we didn't really
enter.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
RFC: Arguably more of what follows could be moved into the if() -
thoughts?
---
v2: New.
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -861,9 +861,11 @@ static void mwait_idle(void)
mwait_idle_with_hints(cx->address, MWAIT_ECX_INTERRUPT_BREAK);
local_irq_disable();
- }
- after = alternative_call(cpuidle_get_tick);
+ after = alternative_call(cpuidle_get_tick);
+ }
+ else
+ before = after = alternative_call(cpuidle_get_tick);
cstate_restore_tsc();
trace_exit_reason(irq_traced);
|