From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08463EE644B for ; Fri, 15 Sep 2023 09:40:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233770AbjIOJkI (ORCPT ); Fri, 15 Sep 2023 05:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233671AbjIOJkF (ORCPT ); Fri, 15 Sep 2023 05:40:05 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECC4B2105 for ; Fri, 15 Sep 2023 02:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=R244OAVYC7tNAKMEhuS6kh2LVOae3N+9/6Hn1T0tkIQ=; b=G8hK4HBq5QEtSvcVs5SpKS8Lcf LrwLYtrVYR4yiWkYCM5Bj4cXJr8pSUw1P4K9uTL7NgH4M9+lEFVBLZxb4HKiD6gLqClBoU37sTkmI iyXU+mTGILIswDxKT+FerVsmC5Sa4/heE+j/nqyNw6QVxM017ETO/BuFBLKUSjmvf6lQDi2i1w4EN 7txBYBl2rDXthazUWK2CAoBlkSjYZmWM1Tp66AdRgI0RMQfMJvXbMmoDXhlHBfuNWaP/R4KVmjIrC ZwFRv3qxX21PN4RXMfMghBmhpUFwkzAx+HiVvC/SzdvGzkpZZaeJFHNWH2nSgJgGF7ucEDvAqInjC utezs8Ww==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qh5Hq-008wIu-22; Fri, 15 Sep 2023 09:38:56 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id B8CA93003F2; Fri, 15 Sep 2023 11:38:55 +0200 (CEST) Date: Fri, 15 Sep 2023 11:38:55 +0200 From: Peter Zijlstra To: Lukas Wunner Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] panic: Reenable preemption in WARN slowpath Message-ID: <20230915093855.GB6743@noisy.programming.kicks-ass.net> References: <3ec48fde01e4ee6505f77908ba351bad200ae3d1.1694763684.git.lukas@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3ec48fde01e4ee6505f77908ba351bad200ae3d1.1694763684.git.lukas@wunner.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 15, 2023 at 09:55:39AM +0200, Lukas Wunner wrote: > 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 > Cc: stable@vger.kernel.org # v6.1+ > Cc: Peter Zijlstra > --- > The original commit went in through the tip tree, hence submitting to > tip maintainers. The commit was backported to v6.1-stable (even though > it wasn't tagged for stable), hence this fix needs a stable designation. > > kernel/panic.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/panic.c b/kernel/panic.c > index 07239d4..ffa037fa 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; > } Urgh, thanks!