Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6438116iob; Tue, 10 May 2022 19:32:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygD/s5TkqVYqpBRhbZSkrCFQblYZOos/LPPYzk7vgejKGHriQU9MUeiuxIporhWKktAGpE X-Received: by 2002:a05:6402:f25:b0:427:bf59:ad72 with SMTP id i37-20020a0564020f2500b00427bf59ad72mr26124085eda.231.1652236361400; Tue, 10 May 2022 19:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652236361; cv=none; d=google.com; s=arc-20160816; b=A8wNrDKSlWiGPqGP/Q1DRTJuLn36YSfgQM0oONGaJtUkIy+lEGW6yWWP72BBr77rnH 6ol64Jz/rV1GVq8O5fB6q2VzDU75ImmzuYFRGV60t4pvixJfQvqrUgiI3oRl8+dFGSXJ AHhIVY2HGLUPltEbcNPNZO3WPwzIhmtVFTaFoZlwZidU/5JmJwgfLxw52ZWaJHJ9QOgB 1ko/l1vqiqE1V0vdVV5uYNgEvgz5Us7CWQsefxfPOrZ1C82tgqGZTyHcirXMWQuVt8i8 kmBeyUNzjlrzRLL6JRxIESFJR+0KoIv6t6yqOI/dCJnpfUe+oOEUHlGnfH3ALjLqRbZ1 5yLg== 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:subject:cc:to:from:date; bh=Kwyzg3kkf1fsKUONXu6rZ24goMZ2XzrlH9XeJYETmF0=; b=0mWL509ZoTgAiqgVcUQ/XjONoxi19KLwydStuqEKVNrgDMVntHyksBDmMICYJxvnNJ yjGyta3ziJgNtsACJl6L3cn5YdOC+Nu1R+IxCfGCT64oZ5NmQBrkgcWvZo6XPxmTjNcS A+de2X+gSWApWc+k5DCDrsya+xEQIexuBSa/7uRRd64MiarxDz87Rdichzv5fgkOAEw9 ZEzU1ocAK3QypEr6cEqiICHo+wczpdoo+s3BJoY13u7E9mqYYCTsP9Wn4EdvKGtL25/f homTH39NAzEHY7aTP70mbQO9ySx5NR4th7JmuRcQH2ydveHE4I7LdSdyqZO7PmLuFRKP QC7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di15-20020a170906730f00b006e871dcbafbsi1159272ejc.575.2022.05.10.19.32.17; Tue, 10 May 2022 19:32:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347906AbiEJRY0 (ORCPT + 99 others); Tue, 10 May 2022 13:24:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237841AbiEJRYY (ORCPT ); Tue, 10 May 2022 13:24:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AE6E2685FC; Tue, 10 May 2022 10:20:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C0FEAB81CC6; Tue, 10 May 2022 17:20:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BA9BC385A6; Tue, 10 May 2022 17:20:17 +0000 (UTC) Date: Tue, 10 May 2022 13:20:15 -0400 From: Steven Rostedt To: Petr Mladek Cc: "Guilherme G. Piccoli" , Evan Green , Andrew Morton , bhe@redhat.com, kexec@lists.infradead.org, LKML , bcm-kernel-feedback-list@broadcom.com, linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org, linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, Linux PM , linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, linux-tegra@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, netdev@vger.kernel.org, openipmi-developer@lists.sourceforge.net, rcu@vger.kernel.org, sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org, kernel-dev@igalia.com, kernel@gpiccoli.net, halves@canonical.com, fabiomirmar@gmail.com, alejandro.j.jimenez@oracle.com, Andy Shevchenko , Arnd Bergmann , Borislav Petkov , Jonathan Corbet , d.hatayama@jp.fujitsu.com, dave.hansen@linux.intel.com, dyoung@redhat.com, feng.tang@intel.com, Greg Kroah-Hartman , mikelley@microsoft.com, hidehiro.kawai.ez@hitachi.com, jgross@suse.com, john.ogness@linutronix.de, Kees Cook , luto@kernel.org, mhiramat@kernel.org, mingo@redhat.com, paulmck@kernel.org, peterz@infradead.org, senozhatsky@chromium.org, Alan Stern , Thomas Gleixner , vgoyal@redhat.com, vkuznets@redhat.com, Will Deacon , Ard Biesheuvel , David Gow , Julius Werner Subject: Re: [PATCH 04/30] firmware: google: Convert regular spinlock into trylock on panic path Message-ID: <20220510132015.38923cb2@gandalf.local.home> In-Reply-To: References: <20220427224924.592546-1-gpiccoli@igalia.com> <20220427224924.592546-5-gpiccoli@igalia.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 On Tue, 10 May 2022 13:38:39 +0200 Petr Mladek wrote: > As already mentioned in the other reply, panic() sometimes stops > the other CPUs using NMI, for example, see kdump_nmi_shootdown_cpus(). > > Another situation is when the CPU using the lock ends in some > infinite loop because something went wrong. The system is in > an unpredictable state during panic(). > > I am not sure if this is possible with the code under gsmi_dev.lock > but such things really happen during panic() in other subsystems. > Using trylock in the panic() code path is a good practice. I believe that Peter Zijlstra had a special spin lock for NMIs or early printk, where it would not block if the lock was held on the same CPU. That is, if an NMI happened and paniced while this lock was held on the same CPU, it would not deadlock. But it would block if the lock was held on another CPU. -- Steve