Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp6115017pxb; Thu, 27 Jan 2022 06:52:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwjGvv3/HSFEnWnmCR+3w4ecRR/w8iVp/lU86a6KIIVpJFuFAdFAf68IbubWtHk1utKU/Z X-Received: by 2002:a17:902:7ecf:: with SMTP id p15mr3851782plb.112.1643295126101; Thu, 27 Jan 2022 06:52:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643295126; cv=none; d=google.com; s=arc-20160816; b=n3EOoDU3R7I0ZPuSFJ4W9oqZAxtGp+gp+HB8FajeTk/StbxRhnxm2YV/TBVTCD9MFQ i9JoKswWImtOPSyAGLg9eAd04Cs/9ptS0uiPW2f+hfoWtC8VIzzRlTyzrRqbSusSS/dR 6cS09R1na6TCOFxy/EVgBYRt6eZ4+2e1z67ZffG759qn0W8Lz3Y/blKGjJnvNKQDZlwC NG1EfyUOZ2EbMN5OHCmtqJLR6wD3r2jVh4+bbql+yTQvpYo1fNNXcStufsF0FQFMqAJr VDuKoE6AOUNLNk5QtKri66GFPyRzK8AW8WYPmYf4731dhGO8uZaYljx8rSsWM1lvPjJ3 GmWA== 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=zUdeV9VjSeLqvfWhftH1z7hD4K58sO8RSwPTTMJM3Go=; b=KdnAugZ1hq3/8/clWcS8uFed++8L8L1BSG7nfFwhAiOB6viGMUBa8vn/F6eN846GFo laM5Ycf6ylHaJv9sFRonUnzeO6mUC9/uFRqns5XmjGXkBurpT6fqlCIrl6XsrlM0eT2S viAve+pLQbrFevFQQs+j0Gx/Hsf3mPEaf/IQZsDF+luyexuH0//KDEzPqf7VPLgLZOFD 8rAoA+/bguch6nbvg9lVmSsPWphixF6/P8Zy2zmvrVO4VG0dWh1camyE2PBR97U5Ibz8 gKqw2RFjtMz6uBBVFXh8FmT3QlshVZpX0TVAuklPkBLc/6EAlJJjFYN+q7Ba7A6TVCTE zFsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Dyq2k1eq; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 e2si2351031pgc.62.2022.01.27.06.51.53; Thu, 27 Jan 2022 06:52:06 -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=Dyq2k1eq; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S238279AbiA0JJK (ORCPT + 99 others); Thu, 27 Jan 2022 04:09:10 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:34474 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238246AbiA0JJI (ORCPT ); Thu, 27 Jan 2022 04:09:08 -0500 From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1643274547; 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=zUdeV9VjSeLqvfWhftH1z7hD4K58sO8RSwPTTMJM3Go=; b=Dyq2k1eq2r2miWQ+6o64QEPL3eIhCxMRbJeJeM9mKnQgdwSrNkz7Zkq049MzNSApaGy/kR Ih5ovkuqy6ohDfaZQ8d26QPWbH1LkdakRw8+Y1kQmhcihb85eEyPntqzpe6zDIbzz3r4oK bKyh8De2XU6D7EOdbAYPt/Cex5b8sz4gySs1kfRYu/ztD9HCxLjzhQb3mjZnk6f+AGsApH TJhGI8CNaUUvCcu9CpEsLfwS2mhnC66GJD5th1KzN6jbGiOsioshsQX9c/SmEM3tkyX3Sm CjDc8fOsP6R4HH64o+c2snZEjszI4yB8eJMVEtWpNyX2AFRUhc+3WYrsusRmTw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1643274547; 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=zUdeV9VjSeLqvfWhftH1z7hD4K58sO8RSwPTTMJM3Go=; b=Uc3Xn44AI9Oo7QLfIRGKvNOYywHexzL8g5BlbiiVILKLR3lFv00BegohSvfKW5rFmz8vzz LlvOlmHfHaWSggBg== To: Sergey Senozhatsky , Stephen Brennan Cc: Sergey Senozhatsky , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] printk: disable optimistic spin during panic In-Reply-To: References: <20220121190222.572694-1-stephen.s.brennan@oracle.com> <20220121190222.572694-3-stephen.s.brennan@oracle.com> <87r18un83x.fsf@jogness.linutronix.de> <87tudqwegy.fsf@stepbren-lnx.us.oracle.com> Date: Thu, 27 Jan 2022 10:15:05 +0106 Message-ID: <87ilu5pmtq.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-27, Sergey Senozhatsky wrote: > Right. So I also thought about placing panic_in_progress() somewhere in > console_trylock() and make it fail for anything that is not a panic > CPU. I think this is a good idea and console_trylock() is the correct place for that. > Back in the days we also had this idea of "detaching" non-panic CPUs from > printk() by overwriting their printk function pointers. We need to keep in mind that printk() is no longer the problem. The records are stored locklessly. The problem is the console_trylock()/console_unlock() within vprintk_emit(). IMHO adding a panic check in console_trylock() should solve that race sufficiently. John