Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2545704lqz; Wed, 3 Apr 2024 00:44:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYh3TVeEn0fDZekJVVn3q60Yd7DycVFa7nhYliZPwkJQge6BuD2+UtBYizZ2gc1yil+I63uFUxw9G+ry3OlOVIBUQCgS+JG0rni1+l+A== X-Google-Smtp-Source: AGHT+IHd+1VjlAtdRST6/PDJX2TOSrxwdNGxO6WmU2uwkv8ccxe+NEYYxOaRAQuuXlCwzJhJE9fp X-Received: by 2002:a05:6870:7183:b0:22e:a1c4:1140 with SMTP id d3-20020a056870718300b0022ea1c41140mr127775oah.22.1712130261862; Wed, 03 Apr 2024 00:44:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712130261; cv=pass; d=google.com; s=arc-20160816; b=LL22Scf88rD7adPiOwALPNmv9UFS8LflgebZnN3eCcjs6eWcVHnDTGX/1KtNRk506M QL4fNjr5QGYQbs3KLVY8dhdZUY3Y4SUeXYxccbXiI37/zkZHWgvlyrDMLwQvdVEt0P2a zGjricVUeGhnzgyx2z5tFmkYhe0M1vUaFkxM2cdhmHNiHb3SYT5u78tnyV8meec75yXa ubdWUlN98IYj3llLGlSc/OwD4zbswxipTdQlk44YRhM+B2tRUyREmMDruG2s5XLBj5EB Y1HxjT13NThs5xSLbUCUJQkdzsZNk21BYSzBDMd64MJB2XgZibhRmar5xZtSLDLbXyDI qxjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=4zx8zzTB6OCY48v3Lo1fOhQeel0GTDH4TqEKk7ytogA=; fh=wOZpovFv/xGiM5QsZVC2oKT1MjA8jcLIcEFWQv/JeNs=; b=Orx0EblJJ8n4D745H0HYoJ/hs5o+MGGrD7YTyzyqtBCuviKBzldGzq/x3GcRIU1rbi 1wvpQTNs8rsi6yBKw6PJ6MPAlesHk4GFNv42QVg7yaJSulFQhTMS7unv5Y/v1wHfdfQz wjfLKaENltcDi7KzuG/u5HibSfEB/1hkDDgB7DGTN5xMNJIcnGS/YVdhaKr3hvf9abRH Hrl1geH9EQ6iLwuYh3MG6VhkJNjorSc+flVvsBNPxb4CaF7wVKuCKWG0xQL6rpugeVdX 6pf0AZd0HZGKcFDL8aNyB3AE2Xv9XfRhTk0Yx7WXNh4ibhLPXJRRvNMvvakEoIAaVg9C idcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zpDXx3Oo; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=quQwbNua; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-129197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129197-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g6-20020a63fa46000000b005dc84ba3c3asi12515212pgk.287.2024.04.03.00.44.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 00:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zpDXx3Oo; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=quQwbNua; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-129197-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129197-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8DDFC28BD82 for ; Wed, 3 Apr 2024 07:41:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 154006EB6F; Wed, 3 Apr 2024 07:40:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zpDXx3Oo"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="quQwbNua" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD9195C8FC; Wed, 3 Apr 2024 07:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712130032; cv=none; b=t1Q58IGnD2Ks7JzUHG9yegG1VixgXKJCo8m2sZQg+XpaNbIhk3D3ChC3QGII+LY0N9sgj+xHqV3nmwfO2H0Y9jZGk6Q+14UMv790IsrO6ee+2BVb8M5g4ZcFMV4sw9y3nBb7rWI7zU6rvCZW9804LkF/f5DsZmkybhueNYT8X1I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712130032; c=relaxed/simple; bh=xz5niPW26FF12C5dQBcipAFWPYqvK4P0bAEQaNE1kcc=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=UnWcpLNt/jbxNlJnJq8Fv9zwt0dUDLsyCsBlWGL1lzsJ74y6jJZAniCTWVF+9x0qDA6xxJVjEaxQvc/F0pdtH9ak9suh/E0vM3e/A/83vgyslcfYs1tdT2rnJk/j2/JhmJ0SxD1yyxhBkf50RNfsj/IQrGQmVYOqkL8wPjOG3uY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zpDXx3Oo; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=quQwbNua; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 03 Apr 2024 07:40:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712130029; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4zx8zzTB6OCY48v3Lo1fOhQeel0GTDH4TqEKk7ytogA=; b=zpDXx3OoEP3jad5U/1FBNi0NEIj0F63VrQTK8SOlViLMXmV/cffZ+KhGPEqWugsN/fJXC0 wk8TELsxU6Q75LdRVgq9fUYETg99jNBoa+Jk2nPQib3srRE8zwP64d0sed7+oXJD00i8k3 3kX1BYXFJStfB1i/69ch22wZOX0A3P3X6aUQfWvGtpicWAd/qyj1GYEdeURMtt2Dk/B67w mLOWKPZdbV4spNl/masbbQR2URu3h1N8/frarFMZBqUdwWnoA7L4KyVwskSKVNIBYtSdAU 1al3/Qe8mTi2L8/oopGWwUsVdX5mCPrgqNwLY8PNnovsTjv1LVfTzuf0POwB+w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712130029; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4zx8zzTB6OCY48v3Lo1fOhQeel0GTDH4TqEKk7ytogA=; b=quQwbNua/998RkjWT52ShQnIREu3AsdrssieLTjgBC7I9B4IdXiV/c5belsy9Y7lliio5b L22LCfFAPMMPZeDg== From: "tip-bot2 for Andrii Nakryiko" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/amd: Ensure amd_pmu_core_disable_all() is always inlined Cc: Andrii Nakryiko , Ingo Molnar , Sandipan Das , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240402022118.1046049-2-andrii@kernel.org> References: <20240402022118.1046049-2-andrii@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171213002832.10875.15810292580039392764.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the perf/core branch of tip: Commit-ID: 0dbf66fa7e80024629f816c2ec7a9f3d39637822 Gitweb: https://git.kernel.org/tip/0dbf66fa7e80024629f816c2ec7a9f3d39637822 Author: Andrii Nakryiko AuthorDate: Mon, 01 Apr 2024 19:21:15 -07:00 Committer: Ingo Molnar CommitterDate: Wed, 03 Apr 2024 09:14:26 +02:00 perf/x86/amd: Ensure amd_pmu_core_disable_all() is always inlined In the following patches we will enable LBR capture on AMD CPUs at arbitrary point in time, which means that LBR recording won't be frozen by hardware automatically as part of hardware overflow event. So we need to take care to minimize amount of branches and function calls/returns on the path to freezing LBR, minimizing LBR snapshot altering as much as possible. amd_pmu_core_disable_all() is one of the functions on this path, and is already marked as __always_inline. But it calls amd_pmu_set_global_ctl() which is marked as just inline. So to guarantee no function call will be generated thoughout mark amd_pmu_set_global_ctl() as __always_inline as well. Signed-off-by: Andrii Nakryiko Signed-off-by: Ingo Molnar Reviewed-by: Sandipan Das Link: https://lore.kernel.org/r/20240402022118.1046049-2-andrii@kernel.org --- arch/x86/events/amd/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c index 985ef3b..9b15afd 100644 --- a/arch/x86/events/amd/core.c +++ b/arch/x86/events/amd/core.c @@ -647,7 +647,7 @@ static void amd_pmu_cpu_dead(int cpu) } } -static inline void amd_pmu_set_global_ctl(u64 ctl) +static __always_inline void amd_pmu_set_global_ctl(u64 ctl) { wrmsrl(MSR_AMD64_PERF_CNTR_GLOBAL_CTL, ctl); }