Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2999337rdb; Tue, 12 Sep 2023 21:00:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5ip01BxGdpMjmui7rJa0Xlz92eFlL7tHGR+mZPJ1kkna8vjzotQf6lslv4MhgSXZOcFR6 X-Received: by 2002:a05:6359:6393:b0:141:146b:15a3 with SMTP id sg19-20020a056359639300b00141146b15a3mr1287835rwb.3.1694577632110; Tue, 12 Sep 2023 21:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694577632; cv=none; d=google.com; s=arc-20160816; b=xOnfDJBipYNbiTPmM2GLl64fhGNZGD65tsXtb1EaFAhkRM5qQxHZOkW8S7WSZohm66 gZiYu4KVUL7QAJXJQMqQMxQqc20/TMhtMjLcE7RtHagc8riBabzqZu+D7PGv3kNNHk7x aKN6CEqJMHzDaU44Aiv7HsRI0GQdabF2t+Khc3N/eRl+WJ09jjxYAr/WqI1ZOYPM8bLo 46xwCSYPGnoujJ87vxkbhW5iqIyLOQABf6gX1mbAlafFaNKXiOGrvrbM8qA73wGsUg31 RcHIH93lm+ntEOt9zthrDIWKWBJje3ae880xTLLLouTV+67hOY0mkmG+yWGDIaVko/im JPvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZAiMGopUwyL/M3ozQV9VdceOhAEEV9kRjWuC9GRkVVQ=; fh=CGeRqfKKrYaxvvhOGObLHRUUue/LLUSLAzhwrHrEV+s=; b=qygksuO2tKZRJ9t9uBzaGPYybuFuKsGofQqINsyq9BrR2t+fT1fFnjp4HyG9Tw9AiC e6gjl7EUrH9DpBWkF7IZ27nR8Ay/OsmuQ/TQQJEAEThBRT0zXunQHIf61jYapN1vqrQU 9q0dxiDGJBYPt3SRWzZCz5HjJ8Om10KEtg9aOA1NW93jpkwqoQship6nHT6Znfb2CuFh sNafDSTczLl/sQUjo1HeVCTJ2iOS43bXxK/5LxfDQb39QJH8P9ooc3SLEgU0TsLXicF4 QiN+XdAnuFiMjtuK/xCoWgF3Z6+73z34AF68qqauZcN0ByW9WMXzbLsff9K5VJZWLZy0 uJXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HVplCqOX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ca25-20020a056a00419900b0068e2b901138si8979442pfb.158.2023.09.12.21.00.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 21:00:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HVplCqOX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6EF9E81DE20E; Tue, 12 Sep 2023 03:46:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234457AbjILKpx (ORCPT + 99 others); Tue, 12 Sep 2023 06:45:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234493AbjILKoy (ORCPT ); Tue, 12 Sep 2023 06:44:54 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8DC51987 for ; Tue, 12 Sep 2023 03:44:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19AB6C433C8; Tue, 12 Sep 2023 10:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694515464; bh=1xq6Mgf32EY2JQOJHQcEgJ3L7Kjn6lb+CzCCKEAz46M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HVplCqOXjJormHSlR2bAyrpRlkyfPFfJEe2vJuJn5mL6+u6rPaN61klmUFrLzRuSe 5Sa1L92QTSATpU1dj8EkdTWjGsnj/WWzmhP8KOGqMIUfVIkFeEKWjk8b2tG0zjp/b9 xqtgWfjjpOwTfTEbUOLbrKRWtRUcX4PIqv58T7E96oZUUX8ILH8QB9nm8VGAt+Rdkp 6IWYMbPSlcWUa/MQkDUqeFHp0NISKywyiGYeDJfCXZnVJzCE82s8FW3NxJre0QFigG rpIRrVXQIh+eEOB++P+ea8VLh8U/vXk81EPR4mlUeCvn5KRm114kdG83D0MpdSGNOL ok5tAtzcqTA7g== From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Joel Fernandes , Thomas Gleixner , vineethrp@gmail.com Subject: [PATCH 5/5] timers: Tag (hr)timer softirq as hotplug safe Date: Tue, 12 Sep 2023 12:44:06 +0200 Message-Id: <20230912104406.312185-6-frederic@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230912104406.312185-1-frederic@kernel.org> References: <20230912104406.312185-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (snail.vger.email [0.0.0.0]); Tue, 12 Sep 2023 03:46:15 -0700 (PDT) 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. Signed-off-by: Frederic Weisbecker --- 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 a92bce40b04b..4a1dc88ddbff 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. -- 2.34.1