Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp6204375pxb; Thu, 27 Jan 2022 08:36:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCCKpWyWhUxOCdHhJs3I92zaOUJX4WoqFElpCDO7rfu8rMt79v7WKBkCjtcAHFD9f6tXUq X-Received: by 2002:a17:903:1207:: with SMTP id l7mr3870983plh.19.1643301390630; Thu, 27 Jan 2022 08:36:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643301390; cv=none; d=google.com; s=arc-20160816; b=Cy514Ihm8w4YegpCN7Ddb5m1CVFzf5uY8KR2IJqp8ZXkrgW2TZRuqFuKN4g3TQzAzp 7EacOJC5XY2jqtI6LoEqisUn1ygb4hKo5k5rabwrC6bK9usqkPAT5hShdbfzoaYkYQox 7Td9FqnO7jAJp5H+JI+8ld2aWeM7l2aIoCIvx5Wxrj/LuKQZX8Arva4uLFEW3+v6+beQ nvWfVLJPl6nWH9g6GDh1A3C7+TcauLdyAmKObNUtt+8POpKLdeZm07lhaE+Xn2iiXJ2c Ori0O/nVBh4/RVMzTFxr0AXlMlKe+b9c4iUuTkuQ5ftSYNzXc9ctxC4Xs8KL/+D55r4g pdxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=+L8VBqp4PAtxyX7hRuZa156QYGOG2O11t3OVdXRWmnA=; b=OL1NevYKPLyVE0yahyWgVsEno1+XHLt/0EupclDW14Avx22KEf8xhIayWkfIWAyfLH eiCwiqE0hHaOvFIADQHGz7YmQVmAkQBmakAhTjtPOrq5ZLL+voqqGM9fzlqDPw4pLU9M kc/e/RJ5rvXG+lZxulXHwjH0dl7WcIc0h45tmnxTzM16sJ4jtk8/fFanBDi2NW9XWTuh +LPFE5rPTkk+LF+uY5s8//yrUQFQYy5aSn5YuDGdftEpQzqLfVWnf7WJsexiRJIL44yO farQBsa8CJ5IMrfdxRn5T3eZL+2LXqBwVo/odf0xuK84DJyOvq3BuY6/u2IlYDLButBF KCJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="iD6/HX69"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="/s2wg8Yy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si2661475pgc.136.2022.01.27.08.35.37; Thu, 27 Jan 2022 08:36:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="iD6/HX69"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="/s2wg8Yy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238631AbiA0JW7 (ORCPT + 99 others); Thu, 27 Jan 2022 04:22:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238629AbiA0JW6 (ORCPT ); Thu, 27 Jan 2022 04:22:58 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A043BC061714 for ; Thu, 27 Jan 2022 01:22:58 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1643275375; h=from:from:reply-to:subject:subject: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=+L8VBqp4PAtxyX7hRuZa156QYGOG2O11t3OVdXRWmnA=; b=iD6/HX691zapFHyUcCF1FeJutThKMgmH9B07qdHrhkp1dPXftSsz4raGQNQVLIimA/WZ/G IJOWxcULQAiW1iHwjl78QqRETqbcGlVw4vBpKkKHpenjcnHRXuXeu3hFPzBlY+vVtyboE5 bOEw29HPic+9dIEP1U8Td504bRnhMPHHzGvVZh586VkqtoMD7W71kgx2mPpPbNsb9eKpJL vaJyWLNvTprfs9vacZFGJHoeDlCeECyeViS2wBWqfkuPio48y7FRbpdclbPG2h8xN44A/N 3jPBnqtjmNyBydcQlgaOzeEEA5qFN7AhwpA2UMNC+UDA6Jh1s4ORUUucMUs0GA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1643275375; h=from:from:reply-to:subject:subject: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=+L8VBqp4PAtxyX7hRuZa156QYGOG2O11t3OVdXRWmnA=; b=/s2wg8YyHWHLZgjZ1NWO+P72Xr+Jo893y9z4aPhr9qd4hyj/A8Z81e8derfNzjXfzdUbvC FTAPOyuvF7AugcCg== To: Stephen Brennan , Sergey Senozhatsky , Petr Mladek Cc: Arnd Bergmann , Steven Rostedt , Andrew Morton , Stephen Brennan , Sebastian Reichel , Andy Shevchenko , Luis Chamberlain , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] printk: Drop console_sem during panic In-Reply-To: <20220126230236.750229-5-stephen.s.brennan@oracle.com> References: <20220126230236.750229-1-stephen.s.brennan@oracle.com> <20220126230236.750229-5-stephen.s.brennan@oracle.com> Date: Thu, 27 Jan 2022 10:28:53 +0106 Message-ID: <87fsp9pm6q.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-01-26, Stephen Brennan wrote: > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -2759,7 +2782,7 @@ void console_unlock(void) > * flush, no worries. > */ > retry = prb_read_valid(prb, next_seq, NULL); > - if (retry && console_trylock()) > + if (retry && !abandon_console_lock_in_panic() && console_trylock()) As Sergey suggested [0], I would like to see the call to abandon_console_lock_in_panic() move inside console_trylock(). This will help to avoid the race between NMI CPU halt and the internal sema.lock spinlock. John Ogness [0] https://lore.kernel.org/all/YfJFjHdg%2FkhNXiRd@google.com