From patchwork Wed Jan 31 23:11:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 195084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:106:209c:c626 with SMTP id mn5csp100040dyc; Wed, 31 Jan 2024 15:56:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3PZrsLHbVyjHnqvqXgkKQ60RcFpBM906MkaX+qbIReY7WJNPx5QtcKwD4BYw7dakpl/R0 X-Received: by 2002:a92:cd08:0:b0:363:7d3c:7d3a with SMTP id z8-20020a92cd08000000b003637d3c7d3amr3712269iln.16.1706745369371; Wed, 31 Jan 2024 15:56:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706745369; cv=pass; d=google.com; s=arc-20160816; b=l6qNi2THidC+Re54ddME+kgIQN2UenrPZgCxDzW457ogSp6fXJNr4Vku9eSkUmEITE /ziLvtkoDwd1VoO4Wc+ccD9bs0U0w4ZDx2O9eBeir/ZOOecmAifKNBh1v7lgyENdviwP 0hlcdCAixlvxGQMyKDDLaAA+k+YaYXGP68v3iUxkR6kWBb1jh3IBbU1KWaXjFx3+uted f/t5NGb3a1pw6xZWvEclZ9T7AoLuQhiH5vWgd9hAyMIFIddWUNvkdpTrj+lUlnzynf07 0H+BolSJG83SA8VfKA22N5GHVF9JUvsbhxaToY53q3gjxzOcs+9T+sAwOsNPQiymu11y kdrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=x2F/PHiemsR+7stqaAaLQFC6GLg7F8xORBV+jQXd7kM=; fh=HdrexM/am6OkvUOpbdYD9YhqIaVkv5Klo16cXfpmHf0=; b=ngFlYKlwt8LLAxwu3uoX9MPMPvD8giv/FrlUYkA3kGitH4DSLQXeWQPkPR94H/3wYG UkQeoIpZTmvZW41kH1v78ZRmOh81uAnTMZJTv4wNiAQtTT1WL+eQW/x9E1j0T4BICJil 1JBcqYJc4ynS+5WlVTf76fZHRojrAs09DK+0/xk+iiREFQyyZigXB82K7ga81JQFvPPz pCn0D+D75XPs+H2M10ujhyZm77FdZIvsetUjWC58Ht6+EMC7joqqJhyvur0eK1MD243D ut9OehqZ+RAYZUMPgHGYxrWrLRtIWBYiFwpQgIj3Gm3Zmp4AbDr2HHAYUNUwDJCigYmV LQqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lWjScDyy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47352-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47352-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCXLmSLMqitRTfdiCw4tyYXk53B5nb+zkY+9cOEDC57q6NdNsBmCe6WepQhjm3hUJYJmdPXatsiIa4/VioxlVICkHdMeXA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c13-20020a65420d000000b005dbe2220330si707895pgq.171.2024.01.31.15.56.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 15:56:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47352-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lWjScDyy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-47352-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47352-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AE2A3B36E6C for ; Wed, 31 Jan 2024 23:30:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79B7B78B6C; Wed, 31 Jan 2024 23:11:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lWjScDyy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C70334F1E0 for ; Wed, 31 Jan 2024 23:11:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706742704; cv=none; b=fJ0QkHEcoUJZ6x1gIjTeKOkliDhqDbi5twqiTYO3O6UuLlCaBDcMy7o4/bTbyLiMwvsWDhm8vPtRyHJUcwHAl8P4GmmJam2kpM8bGuTt6Sk0phxM1CDotVFv+nRHhvg+X0z8uKV4hCy9F0TI6nPaUY0tw+Hpn3mBjQt7ke2x7ig= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706742704; c=relaxed/simple; bh=gpKFxD2je2tWWE8lEBMTW3z9BiZKvLJ/r4INUAW0y0Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fg6wflQ9XOcdEjMxeyqfPm1mc0MhIovhnVEkKFj6brDfqiZpLi/ryd1sOh8NdBrnKm0CMEz3mjuFNq1ViEU3DM4qgZr4/czETQWfaE1JgN6n/9FFiN+HUmTrClWklibCzf+yzJYfwrbNraaiw3a9nYdfw2mFXI5VRCe5NL2yie0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lWjScDyy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73B57C433F1; Wed, 31 Jan 2024 23:11:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706742704; bh=gpKFxD2je2tWWE8lEBMTW3z9BiZKvLJ/r4INUAW0y0Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lWjScDyyCyJYL8k/VWsDJeqGTPrU6Q0ILhUZ+4te5yiJ/JzBrk0rDkMmdvyiOs10F OMMPgOtmXWKz0CevqJZgruEl/nveIdYeiaDJ+xj1jOoBMA5W8i6eUpbrEb2XnoTQNd nsEilF9i79TxkT4Kk9okYcjaKXHkiSh/r3aSBpm2/DmzVVwY9ZiQq4DsantDtFGvFE XVppD2DLIStIt0tGqbTFkOyhoAYlQ3ck1tMxjhXCc7//QDwjrqFEhweWbNr77UvbOV xXzG53fNWZ5npmxYnuwC7QNJzN2sU7uXxjmwjKvtrormdv2HiOLu5gRtY1fqF9C/ka VwuyUtAJFlMww== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Thomas Gleixner , Ingo Molnar , Anna-Maria Behnsen , Peng Liu , Joel Fernandes Subject: [PATCH 08/15] tick: Move tick cancellation up to CPUHP_AP_TICK_DYING Date: Thu, 1 Feb 2024 00:11:13 +0100 Message-ID: <20240131231120.12006-9-frederic@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240131231120.12006-1-frederic@kernel.org> References: <20240131231120.12006-1-frederic@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789652232175037950 X-GMAIL-MSGID: 1789652232175037950 The tick hrtimer is cancelled right before hrtimers are migrated. This is done from the hrtimer subsystem even though it shouldn't know about its actual users. Move instead the tick hrtimer cancellation to the relevant CPU hotplug state that aims at centralizing high level tick shutdown operations so that the related flow is easy to follow. Reviewed-by: Thomas Gleixner Signed-off-by: Frederic Weisbecker --- kernel/time/hrtimer.c | 2 -- kernel/time/tick-common.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 355b5a957f7f..3b456ec7d4fb 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -2224,8 +2224,6 @@ int hrtimers_cpu_dying(unsigned int dying_cpu) struct hrtimer_cpu_base *old_base, *new_base; int i, ncpu = cpumask_first(cpu_active_mask); - tick_cancel_sched_timer(dying_cpu); - old_base = this_cpu_ptr(&hrtimer_bases); new_base = &per_cpu(hrtimer_bases, ncpu); diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index a89ef450fda7..b4af8c743b73 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -410,6 +410,8 @@ int tick_cpu_dying(unsigned int dying_cpu) if (tick_do_timer_cpu == dying_cpu) tick_do_timer_cpu = cpumask_first(cpu_online_mask); + tick_cancel_sched_timer(dying_cpu); + return 0; }