Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2452188pxy; Tue, 3 Aug 2021 06:56:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeUGtlPzWvZIx/CFyu7ZLbZZ4LOdx3MZb+O7uwjpn0+Jb7acb8SnfiVZeMhDT2bnYUu+VT X-Received: by 2002:a17:906:260e:: with SMTP id h14mr20633054ejc.258.1627998979435; Tue, 03 Aug 2021 06:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627998979; cv=none; d=google.com; s=arc-20160816; b=IQleoqoRDzpX3gVwVVOYsWsRWYeQhqEFVZhfBYe5O17G59M1yRyER7FKDYhym+38ut 8iINsgF6S9Oi6xcqtjmF+5qRki0X9nkxocoVq+PNVwYOHgc2CC4BoBIw1ADndAUinB3J xDqcdh1vvySZzgEiFetU/l7dOuKwnQC3VjvUwQC8qy5dfF/v9KUS/1UaOu4l0pg8HH9/ 4Zrkft6aIwHAkSePLlS9Jfe+xfDl0wmAik+zWckBZTObv40ivjMHyULjefErEhDLYCrS HlOkQ3uKfY1D7cVMUcfAkZ8qG+jYqx+WHhNBIW7+BptwzPPbiaYQn2HOu1ORjJd3Mc2G Diaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=lEKQqiJpS+Vuaj4Le3umJoaZo3OML0wqLOPbxvsaiUc=; b=E/zcUbT/RsB6bNGr7jTbraXeOUszO/sTnj8M24qyyDULORkPYdoU4+DjS5x67qqMiz C4xy+jLNDQTNYcasqCNQoynwe4VEj4q4ABByoDNoy9Pt46YSr54zrEp8+pep60olens+ 8FxTMWnpFyNVuJSS+JsUfuuhcpwsBth2TiE44GLRSXFeW5idhAX+ruJwemO9WyabmlnQ A9JgLKk7NaAAKjD+F/0Mxg1U37P7gZCRRt0fl1kgap+EJxtHOLgAOUMxoPBs6DFTXZw7 XdA+EO6xk8DuLU+6PElZ7/kVCYVtYABJkK6RXkOLfm+WW+f2YNdLRr0Hkg0C+No8VjA+ m4wA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w20si12974336edu.376.2021.08.03.06.55.56; Tue, 03 Aug 2021 06:56:19 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236185AbhHCNwh (ORCPT + 99 others); Tue, 3 Aug 2021 09:52:37 -0400 Received: from mga02.intel.com ([134.134.136.20]:39319 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234324AbhHCNwg (ORCPT ); Tue, 3 Aug 2021 09:52:36 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10064"; a="200861751" X-IronPort-AV: E=Sophos;i="5.84,291,1620716400"; d="scan'208";a="200861751" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2021 06:52:25 -0700 X-IronPort-AV: E=Sophos;i="5.84,291,1620716400"; d="scan'208";a="670439422" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2021 06:52:12 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1mAupt-004kJM-Mo; Tue, 03 Aug 2021 16:52:01 +0300 Date: Tue, 3 Aug 2021 16:52:01 +0300 From: Andy Shevchenko To: John Ogness Cc: Petr Mladek , Tony Lindgren , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Andrew Morton , Peter Zijlstra , "Paul E. McKenney" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Jason Wessel , Daniel Thompson , Douglas Anderson , Srikar Dronamraju , "Gautham R. Shenoy" , Chengyang Fan , Christophe Leroy , Bhaskar Chowdhury , Nicholas Piggin , =?iso-8859-1?Q?C=E9dric?= Le Goater , "Gustavo A. R. Silva" , linuxppc-dev@lists.ozlabs.org, kgdb-bugreport@lists.sourceforge.net, Greg Kroah-Hartman , Masahiro Yamada , Nick Desaulniers , Tetsuo Handa , Vitor Massaru Iha , Sedat Dilek , Changbin Du , Sumit Garg , Cengiz Can , Jiri Slaby , Paul Cercueil , Matthias Brugger , Andrew Jeffery , Christophe JAILLET , kuldip dwivedi , Wang Qing , Andrij Abyzov , Johan Hovold , Eddie Huang , Claire Chang , Hsin-Yi Wang , Zhang Qilong , "Maciej W. Rozycki" , Guenter Roeck , Sergey Senozhatsky , Serge Semin , Al Cooper , linux-serial@vger.kernel.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH printk v1 00/10] printk: introduce atomic consoles and sync mode Message-ID: References: <20210803131301.5588-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210803131301.5588-1-john.ogness@linutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 03, 2021 at 03:18:51PM +0206, John Ogness wrote: > Hi, > > This is the next part of our printk-rework effort (points 3 and > 4 of the LPC 2019 summary [0]). > > Here the concept of "atomic consoles" is introduced through a > new (optional) write_atomic() callback for console drivers. This > callback must be implemented as an NMI-safe variant of the > write() callback, meaning that it can function from any context > without relying on questionable tactics such as ignoring locking > and also without relying on the synchronization of console > semaphore. > > As an example of how such an atomic console can look like, this > series implements write_atomic() for the 8250 UART driver. > > This series also introduces a new console printing mode called > "sync mode" that is only activated when the kernel is about to > end (such as panic, oops, shutdown, reboot). Sync mode can only > be activated if atomic consoles are available. A system without > registered atomic consoles will be unaffected by this series. > > When in sync mode, the console printing behavior becomes: > > - only consoles implementing write_atomic() will be called > > - printing occurs within vprintk_store() instead of > console_unlock(), since the console semaphore is irrelevant > for atomic consoles > > For systems that have registered atomic consoles, this series > improves the reliability of seeing crash messages by using new > locking techniques rather than "ignoring locks and hoping for > the best". In particular, atomic consoles rely on the > CPU-reentrant spinlock (i.e. the printk cpulock) for > synchronizing console output. If console is runtime suspended, who will bring it up? Does it mean that this callback can't be implemented on the consoles that do runtime suspend (some of 8250 currently, for example)? -- With Best Regards, Andy Shevchenko