Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4702905rdb; Fri, 15 Sep 2023 09:41:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTIwe+zkiH9rm8oja/Es0hsjkSKEs7S1bHneUQc2rshAHD7KBIRJBffTiV5SVI+byusxh/ X-Received: by 2002:a05:6a20:7483:b0:158:1387:6a95 with SMTP id p3-20020a056a20748300b0015813876a95mr2794756pzd.19.1694796067084; Fri, 15 Sep 2023 09:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694796067; cv=none; d=google.com; s=arc-20160816; b=C83rb0ObyGqtk9D8xu1tM1pekFfTSrcQRnBp4nf3Zq2Y1aeGspvnWgJQ3gnP/cyksH R6VsmC28RLTGqpUllcxqT51PQCzXIUU8HApT/kbOCKdndsFivKQDAk8uEdvlpgngubhA qeBPkS7/MM1dOwSQWQVglVntNGKsocsTodl0876CIxwD+1uS3DVssqS9TglReDYhXpif +AhEdijm2eei1BoH0BqNlb863JGOTnCne5JcivIZkVh/7giLkju7B12E8t4XQN/vxyXj HE8Itl/CvqFKlfz9gKQbNu57RGwDaAn+K8oN4xosxQZEzNL2lbFy9vmcXX8gHOWzeLi3 LfYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=R244OAVYC7tNAKMEhuS6kh2LVOae3N+9/6Hn1T0tkIQ=; fh=2pw/wjv7OR48cy1vFi0pzMx4RGlP+GBg6EWcAQqrF3E=; b=I12rh1F+uzxeJI6B1ke61pYhWrFFZYGlkcPJoVayyeqCX7ZHc5W1YLgLIay5TxLSSl CX2jNkhIRae3egxTkyZJMlDMeypa6yDTFh5KtHTIj/Q6CD58HKxtsYNeblqIdXGl/IF6 7Jf/qyZJeWEhBg+Pal7Bar2bq8gRWNWhGFaEPIT781vB/XY+C+VeIsu8iZdFSs+Vq6aC p/y4239DXztlRCWxu3m8qZPqGNQgKUOb7lbme/fxexL6FrONFdFzYXJN8yhRsswcHGA0 XFuAjmjq3EvKIWE4abhexJvO98DaEyab3OpvvsiDp0BHs3k272O3ZoRG4eiqwVTXPASF kuMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=G8hK4HBq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id u18-20020a656712000000b005774a3b3efdsi3465917pgf.301.2023.09.15.09.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 09:41:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=G8hK4HBq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4AFC7829EA38; Fri, 15 Sep 2023 02:40:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233734AbjIOJkG (ORCPT + 99 others); Fri, 15 Sep 2023 05:40:06 -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> 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 15 Sep 2023 02:40:07 -0700 (PDT) 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!