From patchwork Fri Sep 15 09:36:23 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: 140655 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1287308vqi; Fri, 15 Sep 2023 13:00:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMI99KgLvjHc4X4tW6t+ClSTivz//yuRGzLuKMxoyEbQbpMHuqcb9eJbb0HaiIPArryVLs X-Received: by 2002:a05:6358:4319:b0:139:c75f:63eb with SMTP id r25-20020a056358431900b00139c75f63ebmr2985303rwc.21.1694808033264; Fri, 15 Sep 2023 13:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694808033; cv=none; d=google.com; s=arc-20160816; b=qR6N82emuzDJ0OhtwyILFBEawE0zeGs3aYXE1LBntgSL0RpoLW8N2EHJijK7GdT6lz lJJKKJBP98GABGgNXo8J+HgTdLmfgAwnV/O6THpZU3EEKCDL0dLvgP+8c0ZworjWKiDL CPejIuREzYMrbKl3jzyJEj0bZXNz9ux5kLus5U5k0x+bzpaFp7fwY6Szdqwlqjg08lg9 WI1Zmi49YSNOJhORJJBUGow3IONJ5l8WPw+yWhWohf0O8h2nlXH0gsdMIN2e/jEirk14 PufTFGx85OKKX6Lm4mHvN5Zg7zzjOLICfnChKOyci5uvOMtGUnA522NtJyPEYeuHc5jx n2eg== 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=UFxc2R4QX3SL6qKcyTQop/43MwcshPy66p2kRtRIxKc=; fh=4vfBNVFiAwP0DemeTjMQt5Mu5RUi1hzhGD2L0jN8ZMk=; b=xJEU3Wy9AqANhMXCL6vgbGZNOLyArGqXudMJvi0cSM0s18NgAAiLqRCNVQX/EbNhVk yNm6lVVW6zuvruF+Cn+6yw2VWiXJmIY+jWTu32HkLLYOMEaCoodHyViBHSLP5hl657b3 ewfVDzG/ZqzL50UHuVVqJgIBNy8kLscHGcgEygubDphKYWo1pJjnsDJAltQTb6ENS+dm L4w1x07FliT8fmAWc2U1Gwi/4C6n47f+IXy9WdK8URgZimilTvTsjuHM0rKY2WKvipxC I51youEgV0CedbgyWwum2HLfVH3j8rIzGQ6meqzK0aPrFdAzqVBKBk8Na6reGIs21+jX TjJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=p0EiLuh6; dkim=neutral (no key) header.i=@linutronix.de header.b=iOyHCMeM; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y190-20020a638ac7000000b0056a55e0ccddsi3645186pgd.48.2023.09.15.13.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 13:00:33 -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=@linutronix.de header.s=2020 header.b=p0EiLuh6; dkim=neutral (no key) header.i=@linutronix.de header.b=iOyHCMeM; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F18168051B74; Fri, 15 Sep 2023 02:36:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233698AbjIOJge (ORCPT + 32 others); Fri, 15 Sep 2023 05:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233117AbjIOJgd (ORCPT ); Fri, 15 Sep 2023 05:36:33 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4744171C; Fri, 15 Sep 2023 02:36:26 -0700 (PDT) Date: Fri, 15 Sep 2023 09:36:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694770584; 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=UFxc2R4QX3SL6qKcyTQop/43MwcshPy66p2kRtRIxKc=; b=p0EiLuh6t09J8EmNaD7SQJRVmcG+YZ6GUWswNIUMiipyySKFp1AoW1BfnDWUfIiltKeZBd d6n4JNYVZN2CcozrXuLA0NW5qS85ctrVU51NBdeacmBrB6XkBa6DbuTuN6ccXaIEJ6Vr3i HICxcO5hujpPwzgl1S4ni6YbGVvWUrQY5lH21ZslTcoai9Piyd0ktaNl509MCCi22Iz91v US1df2IVcec9CSRX3Jl8Hk/XW9DLdXHn8JbHb09KY+ytjC6+N/knHctk4ud9UK32ZLq8DF p6TMHmK/Fy8Geq7SSuULIsaHhnMY9ba4h/K5WslkxfJC5aXL+uGNrZh0kd3x1Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694770584; 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=UFxc2R4QX3SL6qKcyTQop/43MwcshPy66p2kRtRIxKc=; b=iOyHCMeM7XpKke5X81o3PnfrvhS+RPJmhECKpWGDY2PDvCI1RSM3grSFtiliiNp36AoSFz 6N2y7wWt1uhjaaBw== From: "tip-bot2 for Lukas Wunner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/urgent] panic: Reenable preemption in WARN slowpath Cc: Lukas Wunner , Ingo Molnar , Linus Torvalds , Thomas Gleixner , "Paul E. McKenney" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <3ec48fde01e4ee6505f77908ba351bad200ae3d1.1694763684.git.lukas@wunner.de> References: <3ec48fde01e4ee6505f77908ba351bad200ae3d1.1694763684.git.lukas@wunner.de> MIME-Version: 1.0 Message-ID: <169477058360.27769.17772363826818333894.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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]); Fri, 15 Sep 2023 02:36:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777106654984736561 X-GMAIL-MSGID: 1777135028005999323 The following commit has been merged into the core/urgent branch of tip: Commit-ID: cccd32816506cbac3a4c65d9dff51b3125ef1a03 Gitweb: https://git.kernel.org/tip/cccd32816506cbac3a4c65d9dff51b3125ef1a03 Author: Lukas Wunner AuthorDate: Fri, 15 Sep 2023 09:55:39 +02:00 Committer: Ingo Molnar CommitterDate: Fri, 15 Sep 2023 11:28:08 +02:00 panic: Reenable preemption in WARN slowpath Commit: 5a5d7e9badd2 ("cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG") amended warn_slowpath_fmt() to disable preemption until the WARN splat has been emitted. However the commit neglected to reenable preemption in the !fmt codepath, i.e. when a WARN splat is emitted without additional format string. One consequence is that users may see more splats than intended. E.g. a WARN splat emitted in a work item results in at least two extra splats: BUG: workqueue leaked lock or atomic (emitted by process_one_work()) BUG: scheduling while atomic (emitted by worker_thread() -> schedule()) Ironically the point of the commit was to *avoid* extra splats. ;) Fix it. Fixes: 5a5d7e9badd2 ("cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG") Signed-off-by: Lukas Wunner Signed-off-by: Ingo Molnar Cc: Linus Torvalds Cc: Thomas Gleixner Cc: Paul E. McKenney Link: https://lore.kernel.org/r/3ec48fde01e4ee6505f77908ba351bad200ae3d1.1694763684.git.lukas@wunner.de --- kernel/panic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/panic.c b/kernel/panic.c index 07239d4..ffa037f 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -697,6 +697,7 @@ void warn_slowpath_fmt(const char *file, int line, unsigned taint, if (!fmt) { __warn(file, line, __builtin_return_address(0), taint, NULL, NULL); + warn_rcu_exit(rcu); return; }