From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lNqbV-009cYZ-9m for kexec@lists.infradead.org; Sun, 21 Mar 2021 05:26:23 +0000 Received: by mail-pf1-x42b.google.com with SMTP id x26so8724052pfn.0 for ; Sat, 20 Mar 2021 22:26:19 -0700 (PDT) Date: Sun, 21 Mar 2021 14:26:10 +0900 From: Sergey Senozhatsky Subject: Re: [PATCH next v1 2/3] printk: remove safe buffers Message-ID: References: <20210316233326.10778-1-john.ogness@linutronix.de> <20210316233326.10778-3-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210316233326.10778-3-john.ogness@linutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: John Ogness Cc: Petr Mladek , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Eric Biederman , Nicholas Piggin , Christophe Leroy , Alistair Popple , Jordan Niethe , Peter Zijlstra , =?iso-8859-1?Q?C=E9dric?= Le Goater , Andrew Morton , Kees Cook , Yue Hu , Alexey Kardashevskiy , Rafael Aquini , Tiezhu Yang , "Guilherme G. Piccoli" , "Paul E. McKenney" , linuxppc-dev@lists.ozlabs.org, kexec@lists.infradead.org On (21/03/17 00:33), John Ogness wrote: [..] > void printk_nmi_direct_enter(void) > { > @@ -324,27 +44,8 @@ void printk_nmi_direct_exit(void) > this_cpu_and(printk_context, ~PRINTK_NMI_DIRECT_CONTEXT_MASK); > } > > -#else > - > -static __printf(1, 0) int vprintk_nmi(const char *fmt, va_list args) > -{ > - return 0; > -} > - > #endif /* CONFIG_PRINTK_NMI */ > > -/* > - * Lock-less printk(), to avoid deadlocks should the printk() recurse > - * into itself. It uses a per-CPU buffer to store the message, just like > - * NMI. > - */ > -static __printf(1, 0) int vprintk_safe(const char *fmt, va_list args) > -{ > - struct printk_safe_seq_buf *s = this_cpu_ptr(&safe_print_seq); > - > - return printk_safe_log_store(s, fmt, args); > -} > - > /* Can be preempted by NMI. */ > void __printk_safe_enter(void) > { > @@ -369,7 +70,10 @@ __printf(1, 0) int vprintk_func(const char *fmt, va_list args) > * Use the main logbuf even in NMI. But avoid calling console > * drivers that might have their own locks. > */ > - if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK)) { > + if (this_cpu_read(printk_context) & > + (PRINTK_NMI_DIRECT_CONTEXT_MASK | > + PRINTK_NMI_CONTEXT_MASK | > + PRINTK_SAFE_CONTEXT_MASK)) { Do we need printk_nmi_direct_enter/exit() and PRINTK_NMI_DIRECT_CONTEXT_MASK? Seems like all printk_safe() paths are now DIRECT - we store messages to the prb, but don't call console drivers. -ss _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec