Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3804047rdh; Fri, 29 Sep 2023 02:53:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8py8vgvp01ecDlFAPF2hz9hQq50ndlqS53Jzn06fzbPAYvGdI2+kIy549Pj9oezh3+gmW X-Received: by 2002:a05:6808:1594:b0:3ae:52f3:ba05 with SMTP id t20-20020a056808159400b003ae52f3ba05mr4377070oiw.28.1695981211134; Fri, 29 Sep 2023 02:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695981211; cv=none; d=google.com; s=arc-20160816; b=lZqcmRPuI1dOlC2L2e1pWeJQsAbScm6kQucMqjsRVWQl2vAHciy77KpkKZ26VhfzgW iXcDgUq2I4rtxbVUMOWoSF5ClDOi9+MxNUdh/dplQKm31+nOr+CKLr/kIPbmUZKdAzMv OLYnU0u4nBx17oFEJhMpVfS5n6kw5af7xoiOBNvIuzOQ9VB47GjepnAnWHwmsepGwbwB u6FN+7+TfGZb11ZxUzky7h+xFQ/s1gB8ZZFxgT+hFRKrEl1N8sFDN27iVJoqfhWphp0C 8fOvbJMxE4FaqR+RqnJQIe1qhO+cDbqOaZ9Gz7geMRfm/PSA8lUGN0DlO+lZzx3MYw7F 6b4A== 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=VQ4i7GMFX0Wcbqf7uT/UkMLF7aH0vc6JCn27kk7fT1o=; fh=+DTEMOLe5SO4iox7iI2jFdWPA8OhkOZisY3Tilqap0Q=; b=sD4DAsW+KPgMDKYQVrnVMcHqehL8veCgYDrsi26zEEIM+GFaX4AysWIrfTp8QPiVPV a5XZSh1cLipMm6gKb+pku3tpzjTUG2tf2bk+y+lEzJQ41xRBH50DoEb5EniqXPuxqbMu BvE/vhPxuRWT4V+cwCvDhc6GE78+GWqerS43FdJquT7oiJt81zc19YwbA1aPGa5XGu6K Rx8NzAEIhHPQOPUBonPsw4a39ytlBatlTUpR6GGW2A3tfqticpVkajYEZ6xwo1rqzRRb bevxMWTyi0TGm1Tx+F5DZSFfHl3f/akwCzehw8kNhPT8DHh96zRDO3cRGzPZxUw92Yu/ P+lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=kOSb50xZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id m1-20020a656a01000000b0057749f3cbe1si23644161pgu.673.2023.09.29.02.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 02:53:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=kOSb50xZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 881788269C5D; Fri, 29 Sep 2023 01:32:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232898AbjI2IcB (ORCPT + 99 others); Fri, 29 Sep 2023 04:32:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232902AbjI2Ibw (ORCPT ); Fri, 29 Sep 2023 04:31:52 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 011BBCEC for ; Fri, 29 Sep 2023 01:31:43 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 83B3B218E9; Fri, 29 Sep 2023 08:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1695976302; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VQ4i7GMFX0Wcbqf7uT/UkMLF7aH0vc6JCn27kk7fT1o=; b=kOSb50xZLelbJ8FkUQIcqKkPi+P0Ft3h4cvJDz9Rt7AOrDj+xM84gphsAmvjRF+XtJxSz2 pLdFRNb3XiJz+cIk25rayru4CSNLaH9yfvDbaQHvmS7s3eYBdeplZ/V1gBfaTJ8t//3l0d bxce4fIk7Q0IdfW0m1S7KxS+XQ8It3k= Received: from suse.cz (pmladek.udp.ovpn2.prg.suse.de [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 1D4722C142; Fri, 29 Sep 2023 08:31:42 +0000 (UTC) Date: Fri, 29 Sep 2023 10:31:41 +0200 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng Subject: Re: [PATCH printk v2 11/11] lockdep: Add atomic write enforcement for lockdep splats Message-ID: References: <20230919230856.661435-1-john.ogness@linutronix.de> <20230919230856.661435-12-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230919230856.661435-12-john.ogness@linutronix.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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 29 Sep 2023 01:32:21 -0700 (PDT) On Wed 2023-09-20 01:14:56, John Ogness wrote: > Invoke the atomic write enforcement functions for lockdep > splats to ensure that the information gets out to the consoles. > > --- a/kernel/locking/lockdep.c > +++ b/kernel/locking/lockdep.c > @@ -3967,9 +3968,13 @@ static void > print_usage_bug(struct task_struct *curr, struct held_lock *this, > enum lock_usage_bit prev_bit, enum lock_usage_bit new_bit) > { > + enum nbcon_prio prev_prio; > + > if (!debug_locks_off() || debug_locks_silent) > return; > > + prev_prio = nbcon_atomic_enter(NBCON_PRIO_EMERGENCY); > + > pr_warn("\n"); > pr_warn("================================\n"); > pr_warn("WARNING: inconsistent lock state\n"); > @@ -3998,6 +4003,8 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this, > > pr_warn("\nstack backtrace:\n"); > dump_stack(); > + > + nbcon_atomic_exit(NBCON_PRIO_EMERGENCY, prev_prio); > } The location of the emergency context looks good. I have just proposed another way for tracking the emergency context. It would allow to call nbcon_emergency_enter()/exit() without any parameter, see https://lore.kernel.org/r/ZRLBxsXPCym2NC5Q@alley Best Regards, Petr