Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1583438rbb; Mon, 26 Feb 2024 14:26:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVArAsLiaY9Hn7tWTJPeIqHOBdJ1xhFwb8+AcWYq/zId+7EaV9ICfQh6XOTCrRcS+SIz4sjHm+2QpH0ClUeQgVyqGykoSIxrsJ4r8eBOg== X-Google-Smtp-Source: AGHT+IElVZLsVf4oOKxo9gHMITGZe23F/q+VovOkfW+lkDYBO1XgEmXNiAE7OqLxYIZLVyPFqExw X-Received: by 2002:a05:6a00:6c93:b0:6e4:69ee:bd74 with SMTP id jc19-20020a056a006c9300b006e469eebd74mr10163077pfb.24.1708986363254; Mon, 26 Feb 2024 14:26:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708986363; cv=pass; d=google.com; s=arc-20160816; b=FxkNh+wvDhBtY5rhJimtQmD2kABc0E7n4D3FWl0VYYq4r7WpPJWCnd5v83evz+F9AR 2aBGn8ktgX30wSAQTC+wGRYFA8bJrUZr9YZtK9L92bJ39HtW5vxN56oYePS6hgIQXX+R A3iO3NjaEPZFnPmoo2dR7+Zr0kiYdjT2PbfY9CBXJTgOro3W4SaYCqmgdSDWV4JQXLti bDH7/iF3oxlnn0gLMBzRieq3YRWA2HSHJeXqWsXi7HxXdESAFzkZ90WTCSX/kkQR70sB 6H/EdlSBHg7v0XdAX3ae9BRqCFgSOJL7+tfHqIytPpCV10JOuVfE8NA3Cn6sLGmoNnCu cT1Q== 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=YYaM4l9yOkcCLpgSnFUHdNv/xE20fMWWty2B2SxxjOs=; fh=9Ax9dUTktkw7GUAcxhp/hScrn1H6VeDItxi6qdujZxg=; b=Y23RkjysU/RD9Ds1Zt2D/1RDJFjUNiHZHjTD3LJVdqB1ujAssvoa13hJDPWOXnk/df XWZNBfPN6BKSoi0D4QIZ0Pm0SOrT1ozifmbODvied0VSkKHXW+T+5nraqWnNqJ7gNz86 vi66LM8JkRdWx8uAp3/fwT8lNRY5Z1hnMCVjjyxSCuR4HDdlEhS4KcZjOPnNSTRbqgSr MpT2mGaLIfFiQm3ypdj2Au9OUchjxjeoEwsawWqpiyoPdFBL1XXJVUClHs8mjOaYExO2 KabsEO6N9VpmVvqwF6lWre9WNoH3REAzWmTl9GjVNfE4qgbETX2eVUGfFVnvzSxoM4xz E06A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UTOHhCGw; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-82393-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82393-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 w186-20020a6262c3000000b006e466aa6862si4386262pfb.122.2024.02.26.14.26.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 14:26:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82393-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=UTOHhCGw; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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-82393-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82393-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 16DEC2859AA for ; Mon, 26 Feb 2024 22:25:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2713C134755; Mon, 26 Feb 2024 22:24:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="UTOHhCGw"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="+9vEqG1T" 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 88411133432; Mon, 26 Feb 2024 22:24:36 +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=1708986278; cv=none; b=RdJWoeDe72yhbIYkIPXhKQBfAR+39lhpuS9HgCCfiVJLCJGOXt6afIxwS+dBITFgM1/RjoV8HfZd2vvwglbfhL2k1ufXPh5p3/q8EhZHbuK+gwCmChro7k+FXtgWO/nrBp+0KBNvoTNmU9CGd5gagXRTKDHB8Agw8FhMUt7TjSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708986278; c=relaxed/simple; bh=KgmlLtNjiqj4Z3n21KCRhCj1nDWKBGEMyQlbcCJHy08=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=sDKXEaY7OZMjoiUe5ZcTLq9UExL5a99tj6W5e0ULaO7SWXVxNrXhjyj95vAygGcGj1u6YXuC/w/HCcEdxspvxQbjWJU+TkYlcLxmmcpDevSvCbEHcqmoQbyyr0FlrM9njBQzIxJ/uHiOedfbJlvVApwoU8W3hjmc7ztgmuMTFGI= 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=UTOHhCGw; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=+9vEqG1T; 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: Mon, 26 Feb 2024 22:24:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708986274; 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=YYaM4l9yOkcCLpgSnFUHdNv/xE20fMWWty2B2SxxjOs=; b=UTOHhCGwGpe2bm52FU4k/pg3hLNnouXLnzPxGX8g8GzXNqqDtFmGf69CykYUV01CFCUSkh t7Hsc2XvepAyRcwM1b8BmSXjAVAR4wlShoB6/kB0Cb+18c65tz6xSs1UpBSIPmknWqVr7C J35QkfTF0CZU0EdHn4rhsB1M2Oyomc+amKGgJf7gzzzbS+FO5DLWXelZ4uhs/FHAVnpqEV wiBB48p3lBnnFOwnYqgBN7eM82z8OvjfQycKj1W+VfPVEyCzkt1cwWKpwZ3gc1KRuzCZ3t NZA/RDk918DC1rrcjog3nlVMM/n/4Ra6bK7UbycTmDFHx3Fs6Dha7wFtLiYEag== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708986274; 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=YYaM4l9yOkcCLpgSnFUHdNv/xE20fMWWty2B2SxxjOs=; b=+9vEqG1TA9sra1qN0dAo0QUypKM44av0H8AT05Qvpitd1jIYa4W14LiSk8ResPr3Zl7EdR aEYAmoqrPYblDkAw== From: "tip-bot2 for Frederic Weisbecker" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] tick: Move broadcast cancellation up to CPUHP_AP_TICK_DYING Cc: Frederic Weisbecker , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240225225508.11587-10-frederic@kernel.org> References: <20240225225508.11587-10-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170898627396.398.11666022364724351280.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 timers/core branch of tip: Commit-ID: ef8969bb552c1c75e997a42d3e2c576b6ed4025a Gitweb: https://git.kernel.org/tip/ef8969bb552c1c75e997a42d3e2c576b6ed4025a Author: Frederic Weisbecker AuthorDate: Sun, 25 Feb 2024 23:55:01 +01:00 Committer: Thomas Gleixner CommitterDate: Mon, 26 Feb 2024 11:37:32 +01:00 tick: Move broadcast cancellation up to CPUHP_AP_TICK_DYING The broadcast shutdown code is executed through a random explicit call within stop machine from the outgoing CPU. However the tick broadcast is a midware between the tick callback and the clocksource, therefore it makes more sense to shut it down after the tick callback and before the clocksource drivers. Move it instead to the common tick shutdown CPU hotplug state where related operations can be ordered from highest to lowest level. Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Reviewed-by: Thomas Gleixner Link: https://lore.kernel.org/r/20240225225508.11587-10-frederic@kernel.org --- include/linux/tick.h | 6 ------ kernel/cpu.c | 2 -- kernel/time/tick-common.c | 3 +++ kernel/time/tick-internal.h | 2 ++ 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/linux/tick.h b/include/linux/tick.h index afff4c2..c7840ae 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -73,12 +73,6 @@ extern void tick_broadcast_control(enum tick_broadcast_mode mode); static inline void tick_broadcast_control(enum tick_broadcast_mode mode) { } #endif /* BROADCAST */ -#if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_HOTPLUG_CPU) -extern void tick_offline_cpu(unsigned int cpu); -#else -static inline void tick_offline_cpu(unsigned int cpu) { } -#endif - #ifdef CONFIG_GENERIC_CLOCKEVENTS extern int tick_broadcast_oneshot_control(enum tick_broadcast_state state); #else diff --git a/kernel/cpu.c b/kernel/cpu.c index 2635080..5a8ad4f 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1324,8 +1324,6 @@ static int take_cpu_down(void *_param) */ cpuhp_invoke_callback_range_nofail(false, cpu, st, target); - /* Remove CPU from timer broadcasting */ - tick_offline_cpu(cpu); /* Park the stopper thread */ stop_machine_park(cpu); return 0; diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index b4af8c7..5224140 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -412,6 +412,9 @@ int tick_cpu_dying(unsigned int dying_cpu) tick_cancel_sched_timer(dying_cpu); + /* Remove CPU from timer broadcasting */ + tick_offline_cpu(dying_cpu); + return 0; } diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h index a3243c4..5f2105e 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h @@ -142,8 +142,10 @@ static inline bool tick_broadcast_oneshot_available(void) { return tick_oneshot_ #endif /* !(BROADCAST && ONESHOT) */ #if defined(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) && defined(CONFIG_HOTPLUG_CPU) +extern void tick_offline_cpu(unsigned int cpu); extern void tick_broadcast_offline(unsigned int cpu); #else +static inline void tick_offline_cpu(unsigned int cpu) { } static inline void tick_broadcast_offline(unsigned int cpu) { } #endif