From patchwork Sat Aug 26 00:57:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krister Johansen X-Patchwork-Id: 1826324 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=templeofstupid.com header.i=@templeofstupid.com header.a=rsa-sha256 header.s=dreamhost header.b=h+Qil2eS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RXdhw3PSNz1yfX for ; Sat, 26 Aug 2023 10:57:50 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qZhcN-0001CW-Up; Sat, 26 Aug 2023 00:57:35 +0000 Received: from rusty.tulip.relay.mailchannels.net ([23.83.218.252]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qZhcK-0001CO-3H for kernel-team@lists.ubuntu.com; Sat, 26 Aug 2023 00:57:33 +0000 X-Sender-Id: dreamhost|x-authsender|kjlx@templeofstupid.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 1838C80EB9 for ; Sat, 26 Aug 2023 00:57:28 +0000 (UTC) Received: from pdx1-sub0-mail-a310.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id A478980A53 for ; Sat, 26 Aug 2023 00:57:27 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1693011447; a=rsa-sha256; cv=none; b=ljJvk5eGeHCvPf7pZusZlrFWuG3Cx4vyRhl9CGLdw6C7UGHZL0TdXnhhh6fgsk9jayour9 FFtUFNYSUqxMGOQ1fzlvIagjcQGRZi+zDhNqwX8Prm44Cd97ZrYdgACblguDbGRLd6o4Es YA9e1uuL7mPQ3gXbb/9VLJn0v4GG4ydjYdqWVxXY4vv7yzJEWB2FFd4eAY0IdynlqeD6JM o9L82eX0kA82jl04w4jFmNsmfKDuO79h/mW3dizprWp/O+HgC75t+NUVaoHkcPa63NxTVj 6j2XbglFrQof+AGXWTqkZmh5GbfOoEUkBf5+G0SwY+iZT3M7qQUZMboCnVLJHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1693011447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: dkim-signature; bh=jObrpMGvw2MHbctZCi2Jm4nUjiH2uoWNk0Xj1DhdfSM=; b=1yifSTa/EDm6RNpa9zfJm1BepoBOxiyCwsBr5XkPRK7TtxUOL+oc2+jGyYG1KVEwtc0xuO +dD6DyHLgBzbk/EyOyVI6v8+Jw9jZiynPRNZp078nqnGOs+M7Bmnma6sA9a76tHRcb/GnJ Y22YuYxTGYpu4K9wgZqjG8U07fYba2fo9A4C4XW2b3T0nVGLtzwTWLLZNKpgILifv3OSVr R1VRrwwBQh+umQr1y9xBKnyxlxOvph4/M6I+VzzxBw4Kwi+B5H0sejDun8eDrH0fPzBVF/ BQ1n7CKJvO2eL7t6bAY6MiDqcVmzu3pp12Tr4M1BUM1p8BRyZuDXy3Sywdh9Gg== ARC-Authentication-Results: i=1; rspamd-6fd95854bb-6p72p; auth=pass smtp.auth=dreamhost smtp.mailfrom=kjlx@templeofstupid.com X-Sender-Id: dreamhost|x-authsender|kjlx@templeofstupid.com X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|kjlx@templeofstupid.com X-MailChannels-Auth-Id: dreamhost X-Power-Well-Made: 6e97e10f5899c9c7_1693011447884_4048081857 X-MC-Loop-Signature: 1693011447884:3319287337 X-MC-Ingress-Time: 1693011447884 Received: from pdx1-sub0-mail-a310.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.104.240.44 (trex/6.9.1); Sat, 26 Aug 2023 00:57:27 +0000 Received: from kmjvbox (c-73-231-176-24.hsd1.ca.comcast.net [73.231.176.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kjlx@templeofstupid.com) by pdx1-sub0-mail-a310.dreamhost.com (Postfix) with ESMTPSA id 4RXdhR30Qzz4S for ; Fri, 25 Aug 2023 17:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=templeofstupid.com; s=dreamhost; t=1693011447; bh=jObrpMGvw2MHbctZCi2Jm4nUjiH2uoWNk0Xj1DhdfSM=; h=Date:From:To:Cc:Subject:Content-Type; b=h+Qil2eSpdojGNjXbWwe/OdlCF2X+Ul+0gG/iLRtF8PdWSbprq7ILZo117g300TeL QILsV+pIl1AhtWex+8HgJDI9So36niZ4Jcp6n/qe3unM2kC6L/lG7HGFCK4gy4VTbq NAxC01ogeVpYH1PXCI9Bh77ob8wZs617EZ2imr4iBAnx1w+G+y6lg/nW0PNGTsMjDn 3XruSh3sPAFm7veonZlPXGaHAuAzWyDqQi/dkdNttZGaEANIDtSBOJYdu4dc5MiCD1 DPX3pEf6khAg3Erf9GXhol/qwfpgGiqnfz0LMJsBVrP+F0AfeSeX3601bvIYWG9bsR sjsK4eK2INgmA== Received: from johansen (uid 1000) (envelope-from kjlx@templeofstupid.com) id e009d by kmjvbox (DragonFly Mail Agent v0.12); Fri, 25 Aug 2023 17:57:14 -0700 Date: Fri, 25 Aug 2023 17:57:14 -0700 From: Krister Johansen To: kernel-team@lists.ubuntu.com Subject: [SRU][J/L][PATCH 0/1] Xen timekeeping performance improvement Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Reaver Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Dear Ubuntu Kernel Team: This patch modifies which default clocksource is selected on Xen. Users, especially those on EC2, are encouraged to select tsc as their default clocksource. However, this requires manual tuning of the operating system. Kvm can determine if it safe to use the tsc, and will default to that instead of its pvclock when appropriate. This patch does the same for Xen instances. If appropriate, it's fine if this is applied to only the linux-aws branches. Not all Xen EC2 instances advertise explicit nomigrate support, however, on those that do we'll select tsc by default. On the subset of hosts where this is advertised, users will safely default to the more performant clocksource. [Impact] Xen instances default to the xen clocksource which has been documented to be slower. This is required for instances where the tsc is not safe to use, or the guest is subject to migration. On some platforms the performance impact can be high, and users are encouraged to select the tsc when appropriate. Instead of leaving up to users to figure this out by reading a variety of different documents, pick the fast clocksource when it can be determined to be safe to do so. [Backport] Clean cherry pick. No conflicts applying to 5.15 or 6.2. [Test] Booted EC2 xen instances with and without this patch and validated that on those that properly advertised the required criteria via cpuid, that the clocksource defaulted to tsc instead of xen. [Potential Regression] Potential is low, since only absurd configurations could lead to a problem. If this is considered risky, it can be applied to only linux-aws where the documented guidance is for users to enable tsc as the clocksource on Xen. Krister Johansen (1): x86/xen/time: prefer tsc as clocksource when it is invariant arch/x86/xen/time.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) Acked-by: Stefan Bader