From nobody Sat Apr 18 09:33:06 2026 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 6103748034C; Sat, 28 Feb 2026 15:36:51 +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=1772293017; cv=none; b=o6tbstQprDTWoP+er8wROpe0YuTZ+PdMFzV5FmJ29LAnctAoMd73xc8uMberGkdXUZznt4acyolcrOj5quwiOocYpfl/zx0NvqRpUdSfULecexM21HRIlixkXTw+S94scck5OwIABNH39wByME+YS4BBkne9jstmBBYVqZX9+xE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772293017; c=relaxed/simple; bh=hzSdP/gyETVx4tU2srxPaYWTbw9+X5YEunXKF7QpbLw=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=F9HIqCUB9xAw4tlU27+HxNi+JZ/l2xmam0WV4iLE92dW2FW5Jf1dxv/kaBMlfZNSqKjTwWlqw5yLllTZTsp88gpHbENVSWNQLo8rxFBsq6SKIJqxX0H3iOW8YKtTigH3uVHuP55//oKGopk8UmMk8HSb37sZOzSIrHwsGXCjZ3w= 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=xE9O0egu; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ugw7PAwF; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xE9O0egu"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ugw7PAwF" Date: Sat, 28 Feb 2026 15:36:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772293009; 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=qsSh+NY1hDsIwqjh+3pqsIVUUFLu4cqu3q4GS4JoVJ4=; b=xE9O0eguupqnS9XOY42wODx8iygIzXMRzisScAvfGIu0P9dlKg97QPbPjCusSSKD8inrGm aJicy8bF4nT5Ae0Vj9r7Asv3vQ7CmEy0uPRWWedc/K8ySosiTswIeJC58Hte9k97rjz9lg 36DnfumppB5t29aPtvOzYAliJJkKLx5sOfdBqzVA6nDEYGQohei2zzlFphCyk3UAocF36H OD0tRY/JUapZL2rdoUsohSdGFOw65+KjO7PQ9rPQYEt4GAdtGywujrxpt1c3dGNE0GiWuO 3PMS0/3jv5MC5w1eJ5OU6wF98mS3lp7NBV0QgE7Q+LLKKAuRgwiEqLcyW0AWhw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772293009; 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=qsSh+NY1hDsIwqjh+3pqsIVUUFLu4cqu3q4GS4JoVJ4=; b=ugw7PAwFZ98xgFXlW0RAkOxwdC3/ekItiJCuTTQlgSkZimU/XC4NdLVokqbHcB1igFOUKe LqGzwI83tCEp32Cg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/hrtick] x86: Inline TSC reads in timekeeping Cc: Thomas Gleixner , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260224163429.741886362@kernel.org> References: <20260224163429.741886362@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177229300859.1647592.13245776203770731377.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: quoted-printable The following commit has been merged into the sched/hrtick branch of tip: Commit-ID: b27801189f7fc97a960a96a63b78dcabbb67a52f Gitweb: https://git.kernel.org/tip/b27801189f7fc97a960a96a63b78dcabb= b67a52f Author: Thomas Gleixner AuthorDate: Tue, 24 Feb 2026 17:36:24 +01:00 Committer: Peter Zijlstra CommitterDate: Fri, 27 Feb 2026 16:40:07 +01:00 x86: Inline TSC reads in timekeeping Avoid the overhead of the indirect call for a single instruction to read the TSC. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20260224163429.741886362@kernel.org --- arch/x86/Kconfig | 1 + arch/x86/include/asm/clock_inlined.h | 14 ++++++++++++++ arch/x86/kernel/tsc.c | 1 + 3 files changed, 16 insertions(+) create mode 100644 arch/x86/include/asm/clock_inlined.h diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e2df1b1..d337d8d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -141,6 +141,7 @@ config X86 select ARCH_USE_SYM_ANNOTATIONS select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH select ARCH_WANT_DEFAULT_BPF_JIT if X86_64 + select ARCH_WANTS_CLOCKSOURCE_READ_INLINE if X86_64 select ARCH_WANTS_DYNAMIC_TASK_STRUCT select ARCH_WANTS_NO_INSTR select ARCH_WANT_GENERAL_HUGETLB diff --git a/arch/x86/include/asm/clock_inlined.h b/arch/x86/include/asm/cl= ock_inlined.h new file mode 100644 index 0000000..29902c5 --- /dev/null +++ b/arch/x86/include/asm/clock_inlined.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_X86_CLOCK_INLINED_H +#define _ASM_X86_CLOCK_INLINED_H + +#include + +struct clocksource; + +static __always_inline u64 arch_inlined_clocksource_read(struct clocksourc= e *cs) +{ + return (u64)rdtsc_ordered(); +} + +#endif diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index d9aa694..74a26fb 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -1201,6 +1201,7 @@ static struct clocksource clocksource_tsc =3D { .mask =3D CLOCKSOURCE_MASK(64), .flags =3D CLOCK_SOURCE_IS_CONTINUOUS | CLOCK_SOURCE_VALID_FOR_HRES | + CLOCK_SOURCE_CAN_INLINE_READ | CLOCK_SOURCE_MUST_VERIFY | CLOCK_SOURCE_VERIFY_PERCPU, .id =3D CSID_X86_TSC,