From patchwork Wed Sep 27 15:01:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 145421 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2705046vqu; Wed, 27 Sep 2023 08:22:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGOLbN4B2QyrK6yGub18ME/neuhypYaL5K0hj6RPBRrqOVHEWPnMSQRegCxkAY7SQrQqJP+ X-Received: by 2002:a05:6870:1c9:b0:1b7:3432:9ec4 with SMTP id n9-20020a05687001c900b001b734329ec4mr2826370oad.10.1695828168397; Wed, 27 Sep 2023 08:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695828168; cv=none; d=google.com; s=arc-20160816; b=L10hPPNy9lcBwPOHZbWT658faVt64U5CPdbOWmqj1KTK9qNyd5qJgN1ewylOPNpOcf vd6zDwwAj+OHBBQfLmnf22NV/dr5cj8NJWG3Pqau9rpQqJeCcrdkyfMnIHawLLJ9FkC6 gGhyWnLRdJ+cJv2D4Bf3uBJ3V9nYzRM8RSz580vKc5EhDRDDfGNiF6ibmtXCTBwmyJGp 0qLnrgjRLKdzfqJZFY9rp0SjgpNMRpV5l8IMm8vJA6TftNspMfVbSi/dI3dMawj9DUa8 M/C2ycDLQfKWtIHZiN/r4Nsd8zp7dOawCMcWUn3Jg2zBmzeVFQsMpLQZfjQp5X21ciz7 UaSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=0ZhjOmSStMre4n+1d7k4HxOZCTiNq9yelwWAhe5xHFM=; fh=yyNkRurbFrx4QFZ2Opd9hXEHGUXwvd+GvGIUUhrk5jM=; b=H7BbnWntpmme2mfucH9qjasNqRgPtpqEq3PFBtwnoxHcIpHuS8XVoHb2tQc0r8CkUS +bzzAnImHeN7ekewCELd1G3+b3mXcRABFWA5eRHK8Mx6+53BI8pmn/TB56N7d4gRBUyR NS1veJzft3lHeizRKRC+F8xPPqKw8OPAjGZ55dwY1rg7w8JVuD8VQ71OBidHToC+d4L7 gFKlTXPu3Mo8397bRhIH94YiuNvp7oKXwpdV8wi6GJzjGLq8QCA25D9VxmrhQkG/2SlD FBjUu/Lm+dwhftTM4omPuvr31UdWU3Fyslh5xoJVvTp9rLaKANWVJr9vJq1JAV/MeK+E 9QAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=VksODYSt; dkim=neutral (no key) header.i=@linutronix.de header.b=4ifXXgSQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id b67-20020a633446000000b005849dc13e74si5359958pga.56.2023.09.27.08.22.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 08:22:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=VksODYSt; dkim=neutral (no key) header.i=@linutronix.de header.b=4ifXXgSQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9C432801B398; Wed, 27 Sep 2023 08:02:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232284AbjI0PB4 (ORCPT + 19 others); Wed, 27 Sep 2023 11:01:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232067AbjI0PBg (ORCPT ); Wed, 27 Sep 2023 11:01:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F5D1196; Wed, 27 Sep 2023 08:01:34 -0700 (PDT) Date: Wed, 27 Sep 2023 15:01:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695826892; 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=0ZhjOmSStMre4n+1d7k4HxOZCTiNq9yelwWAhe5xHFM=; b=VksODYStvXKNho2lLF7tELW2L0FHJBbGSlP/9czDTTXsLak4fQ/9QpR71/T/8hRZbo5Vyk ISpBA0pJt8jcso+qVeStMv1RkxDmZotu7J5aygVwydcTslp0D7YZYfcT3YN8AmtLIYBfcR 8kmez+zK3xXTSr7leYS+gV9SMPsugZ1CUwwjB5B8GWlB+CE/YnQrRPeUAfahdNZN1WxoWS YfnmR4U5hx8Xg9AZbemQ/Lx6j0InEoHvsbaQcpKblOh0pS7NJbtyOtXvhf906SOCJG/kfQ FjiEIeD33T97hOqnGAvZw6xsZI0F3mc8eUH6WvZexl4iiZGJM7hOGGN5VBw/pg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695826892; 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=0ZhjOmSStMre4n+1d7k4HxOZCTiNq9yelwWAhe5xHFM=; b=4ifXXgSQSnqb1Ezd+9cuijaif3i3PdydetiSXEXVNJpsbwZFFERwJ2WnA0gSAcQHB8F/Su 1KTG02d/4zI9rLCw== 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] timers: Tag (hr)timer softirq as hotplug safe Cc: Frederic Weisbecker , Thomas Gleixner , "Joel Fernandes (Google)" , stable@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230912104406.312185-6-frederic@kernel.org> References: <20230912104406.312185-6-frederic@kernel.org> MIME-Version: 1.0 Message-ID: <169582689232.27769.17167363673386375890.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 27 Sep 2023 08:02:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776835808613616282 X-GMAIL-MSGID: 1778204717473354859 The following commit has been merged into the timers/core branch of tip: Commit-ID: 1a6a464774947920dcedcf7409be62495c7cedd0 Gitweb: https://git.kernel.org/tip/1a6a464774947920dcedcf7409be62495c7cedd0 Author: Frederic Weisbecker AuthorDate: Tue, 12 Sep 2023 12:44:06 +02:00 Committer: Thomas Gleixner CommitterDate: Wed, 27 Sep 2023 16:54:03 +02:00 timers: Tag (hr)timer softirq as hotplug safe Specific stress involving frequent CPU-hotplug operations, such as running rcutorture for example, may trigger the following message: NOHZ tick-stop error: local softirq work is pending, handler #02!!!" This happens in the CPU-down hotplug process, after CPUHP_AP_SMPBOOT_THREADS whose teardown callback parks ksoftirqd, and before the target CPU shuts down through CPUHP_AP_IDLE_DEAD. In this fragile intermediate state, softirqs waiting for threaded handling may be forever ignored and eventually reported by the idle task as in the above example. However some vectors are known to be safe as long as the corresponding subsystems have teardown callbacks handling the migration of their events. The above error message reports pending timers softirq although this vector can be considered as hotplug safe because the CPUHP_TIMERS_PREPARE teardown callback performs the necessary migration of timers after the death of the CPU. Hrtimers also have a similar hotplug handling. Therefore this error message, as far as (hr-)timers are concerned, can be considered spurious and the relevant softirq vectors can be marked as hotplug safe. Fixes: 0345691b24c0 ("tick/rcu: Stop allowing RCU_SOFTIRQ in idle") Signed-off-by: Frederic Weisbecker Signed-off-by: Thomas Gleixner Reviewed-by: Joel Fernandes (Google) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230912104406.312185-6-frederic@kernel.org --- include/linux/interrupt.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index a92bce4..4a1dc88 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -569,8 +569,12 @@ enum * 2) rcu_report_dead() reports the final quiescent states. * * _ IRQ_POLL: irq_poll_cpu_dead() migrates the queue + * + * _ (HR)TIMER_SOFTIRQ: (hr)timers_dead_cpu() migrates the queue */ -#define SOFTIRQ_HOTPLUG_SAFE_MASK (BIT(RCU_SOFTIRQ) | BIT(IRQ_POLL_SOFTIRQ)) +#define SOFTIRQ_HOTPLUG_SAFE_MASK (BIT(TIMER_SOFTIRQ) | BIT(IRQ_POLL_SOFTIRQ) |\ + BIT(HRTIMER_SOFTIRQ) | BIT(RCU_SOFTIRQ)) + /* map softirq index to softirq name. update 'softirq_to_name' in * kernel/softirq.c when adding a new softirq.