From patchwork Wed Jan 24 17:04:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 191667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp1127368dyi; Wed, 24 Jan 2024 09:07:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2XkhZSZTze7f8pIZONB9UqTJ2AaSoQW8WwHfLd8V+GAU1eqMgKy2w6FnTrGFSWn2zgdyz X-Received: by 2002:a9d:63ce:0:b0:6db:d8a9:4205 with SMTP id e14-20020a9d63ce000000b006dbd8a94205mr2006992otl.32.1706116069640; Wed, 24 Jan 2024 09:07:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706116069; cv=pass; d=google.com; s=arc-20160816; b=uTjUdYEqGzXggVdhMZZtBdAMPUvwjL+uCICJa6J3SDCXwFSpzdNZx817x8w4OASNT/ ylpYTfBQxhHl5gswXi8DbCUE56rBDyayNjlGslkAoK4+lCFEKXAI4hd/8RO1h2xCdLv2 INB+hHUE9i2CveHEzGdHdoxEbL+qy/CW4KZ9lB4h6i+dzCqe8YSXm/So2uhDAjImStQd 72uibAiA8lG2FNMpu2YAfKBVVDrldDkVKMZfURD0r5YHNQ0blL5Ga9lORTAVE3h6DgO9 4bhRkg3Od2cpppWLOTwcN+SdsTyQmtfDM6IJBBsxadVuPJhvVcV3cUcZWgTzzTvauYPo ekwQ== 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=47IDbJ/2Qd9096ADsC8pqCdxiKBGNBRLqrnYDq4xfIE=; fh=9AYDxpIF3ws21qQDvjghHSFUuXpDdpq2Zh/SbnasVRo=; b=IU0atQj1Iv+IoicOmaISjGxdT6Rf6NQjF+QDQ9BGTzUCHPpeYJfDLKCPG9sWjK+wmd jlMBt2APt9ml+HXH4khBmKptJhDE+wGBQxj8u8B8cy+Imo/IGSCcTVqxi5myUR1X8gAc RE/EJFB4Mn1nyAB5Rtm4Tv2KsZvJDbpjh5SUu1ZimHXzA/uJzDUuhyuF/bOYe0dW/IKS N+yvVeq9MzC894ezVNeV53LOI2tmmscBBtO7JE1OygSKl/F0hSnJUzMa/Jug/cs5+AbJ BHCAxqsTUZXKiL+CzpYl6dv+oN2CtsWoYWIxRDtfkvem9nRyhvrodFjP++qIoQV0Dkvr 8kgA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=apydmotH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-37387-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37387-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g6-20020a0561020cc600b0046b0cb8362csi234808vst.127.2024.01.24.09.07.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 09:07:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37387-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=apydmotH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-37387-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37387-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BEE751C24480 for ; Wed, 24 Jan 2024 17:07:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54DF186AF8; Wed, 24 Jan 2024 17:05:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="apydmotH" 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 BDE9186AC6 for ; Wed, 24 Jan 2024 17:05:28 +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=1706115928; cv=none; b=LBjxQe5InB4ggCyCDnIhOng2V+9mV3DlT/pLLeXT4HM3Ojaq6U5Wa5h7Y2TQqeQTa5vlPTkfhJ6Z3JGW+KKAApcJfPVtCR5rus5L22/AsXKS/K3i2mSTPcjGdmfRbDQbXPPe2IYtd8gALjWTWE3dOaWDCZ9JiIbVM6J9u+T455k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706115928; c=relaxed/simple; bh=j4R9xWxhSKcn6+gqDWFiRkuawBSZ7hDhyExkS5TrEj4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S/aPUQGaZlSsIZk/sf1oPPzGCoDpiq2cApEJW5fjxfXSbTCUo8P8qgIWVYhljOfPNW7Q4RORf6FVRWHR+BFq1fBKL26VgaieaTPDjm2bhO/ECA4v+8C0M77nKC8j0iXmiA0/0VRp9fy8ybBOLGiYgRLz041nxqMREeSEmSrYjj8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=apydmotH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CABACC43399; Wed, 24 Jan 2024 17:05:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706115928; bh=j4R9xWxhSKcn6+gqDWFiRkuawBSZ7hDhyExkS5TrEj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=apydmotH4lzn6QzExX3lySa/jAZFJcG0Q6HLcUJenVqEfGEBvTTaQEWeVuJhQXXtQ keVRazCDXwRioMOrhz6Tc469cP/ptxVQ/9EkxPD9LIz9AxKtCnISCzOpWg8tW1Qo54 q9bBS2UbpAQw2JGomGCHIAkujRiVXlzE7CH02WlvP93Sm5COZ2scJdGEm/SoxBBoGO us2HpGruBkN7RmAgBB0vKiNsT5aO5kfMjC2WKNE/frpmH9jUPoYs5AwVpZw/jY7IB7 JASAbXqxph4xOG9DSkVQ2Dskxksq40FWyqvZMWFnjzNkH8+TUQyP8eRXbgDifbAggL FAFsABhS7LqDg== 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: Wed, 24 Jan 2024 18:04:52 +0100 Message-ID: <20240124170459.24850-9-frederic@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124170459.24850-1-frederic@kernel.org> References: <20240124170459.24850-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: 1788992363865023243 X-GMAIL-MSGID: 1788992363865023243 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. Signed-off-by: Frederic Weisbecker Reviewed-by: Thomas Gleixner --- 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; }