From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751020AbdBBGFZ (ORCPT ); Thu, 2 Feb 2017 01:05:25 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35756 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750842AbdBBGFY (ORCPT ); Thu, 2 Feb 2017 01:05:24 -0500 Date: Thu, 2 Feb 2017 15:05:38 +0900 From: Sergey Senozhatsky To: Steven Rostedt , Petr Mladek Cc: Sergey Senozhatsky , Andrew Morton , Linus Torvalds , Jan Kara , Tejun Heo , Calvin Owens , Ingo Molnar , Peter Zijlstra , Andy Lutomirski , Peter Hurley , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCHv7 4/8] printk: always use deferred printk when flush printk_safe lines Message-ID: <20170202060538.GA419@jagdpanzerIV.localdomain> References: <20161227141611.940-1-sergey.senozhatsky@gmail.com> <20161227141611.940-5-sergey.senozhatsky@gmail.com> <20170201110648.33651ee8@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170201110648.33651ee8@gandalf.local.home> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (02/01/17 11:06), Steven Rostedt wrote: [..] > > static void printk_safe_flush_line(const char *text, int len) > > { > > /* > > - * The buffers are flushed in NMI only on panic. The messages must > > - * go only into the ring buffer at this stage. Consoles will get > > - * explicitly called later when a crashdump is not generated. > > + * Avoid any console drivers calls from here, because we may be > > + * in NMI or printk_safe context (when in panic). The messages > > + * must go only into the ring buffer at this stage. Consoles will > > + * get explicitly called later when a crashdump is not generated. > > */ > > - if (in_nmi()) > > - printk_deferred("%.*s", len, text); > > - else > > - printk("%.*s", len, text); > > + printk_deferred("%.*s", len, text); > > } > > The helper function was there because of the if statement. Just nuke > this function and call printk_deferred() directly. You can move the > comment to the caller. indeed. thanks. Petr, how would you prefer to handle this? -ss