[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/2] xen/x86: don't send IPI to sync TSC when it is reliable
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
- Date: Tue, 8 Jul 2025 11:32:37 -0700
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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=zNpy3f9v/76jXn3HtQF4Prk92pw59tzhtGk12dtjF8g=; b=O8DBP8xhYl+BmRAXm6G0lmuHkJZfhBtZXAB+hwEJ3/MX67aAl+ViOEfOQxx2S7r7s8qvpEoaCnXx1CO7kB8giS+4Elimt6bvN1goBHqKmGE6gZl16DRormEHhLgZQvTf2R0BDGkhTrfFtulTc9z55Ej663qB3+Sbi/SRMmB6H+AgzyUwx8uusigpFnHeStZR89SHYipc34ksp4J3h7lE4evw0I8I1FtVs/PyyDNx75hFP7OsubowfC7a3RYM6H3+FYo8wVPsFj1koAuvFW2I4kkuPFg6p1IfCXyCEVQbnY30D/ncSPUrp/HcBMCR+dpLzVfh2J4ToPNQImO2jyz8XA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NfLb8+fyJ+bKZEX/3s6hjGHvxAjspOp+Bwb7/XqPr+rsx9+9UiyyGvF9+Or4Xb20LNnXEgYoMPaEPjkBHxXbMhY3WtmSLHa+Wbopvj24tbD+2OqAOY63cqtionbdvNZQHUAPpdz4tdcq6DQg8PIzzKYwbXbmCqzrW5g5hiA/p4y33lq+J8PRP6O45nkGM+i3pOlMavEObaHXDAKagWdm9aWJipTOM9tajaq0AaxSqtlqyKl3Zgn3CpTfCSef3i3/UrTD0bdiEk77oEBGjnpLYUM+vUX1u8gxEIYKbcruqH+eb77DY82hcG38Dn/H1TPo59+KKzFpOnIgCTQQVMQWHw==
- Cc: <jbeulich@xxxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <roger.pau@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>, <Xenia.Ragiadakou@xxxxxxx>, <alejandro.garciavallejo@xxxxxxx>, <Jason.Andryuk@xxxxxxx>
- Delivery-date: Tue, 08 Jul 2025 18:32:56 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On real time configuration with the null scheduler, we shouldn't
interrupt the guest execution unless strictly necessary: the guest could
be a real time guest (e.g. FreeRTOS) and interrupting its execution
could lead to a missed deadline. The principal source of interruptions
is IPIs.
When TSC is the chosen clocksource, we know it is reliable and
synchronized across cpus and clusters. Thus, we can return early
time_calibration because the calibration is not needed, removing the
related Xen timer and IPIs.
Also remove the master_stime write as it is unnecessary.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
---
Changes in v2:
- simplify the patch simply by returning early if clocksource_is_tsc()
- also remove setting r.master_stime as it is not needed
---
xen/arch/x86/time.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 59129f419d..d72e640f72 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2297,11 +2297,7 @@ static void cf_check time_calibration(void *unused)
};
if ( clocksource_is_tsc() )
- {
- local_irq_disable();
- r.master_stime = read_platform_stime(&r.master_tsc_stamp);
- local_irq_enable();
- }
+ return;
cpumask_copy(&r.cpu_calibration_map, &cpu_online_map);
--
2.25.1
|