From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750903AbdIEKBt (ORCPT ); Tue, 5 Sep 2017 06:01:49 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:33442 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbdIEKBr (ORCPT ); Tue, 5 Sep 2017 06:01:47 -0400 X-Google-Smtp-Source: ADKCNb5b0hTQug6hxMACCG+dQJM2Ga6hK4eSK8bs+FfOACgIzpl7/mMXD6pa04YXa7NY8kuZxWMIqw== Date: Tue, 5 Sep 2017 18:59:00 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Joe Perches , Steven Rostedt , Linus Torvalds , Pavel Machek , Sergey Senozhatsky , Jan Kara , Andrew Morton , Jiri Slaby , Andreas Mohr , Tetsuo Handa , Linux Kernel Mailing List Subject: Re: printk: what is going on with additional newlines? Message-ID: <20170905095900.GC2066@jagdpanzerIV.localdomain> References: <20170829195013.5048dc42@gandalf.local.home> <20170830010348.GB654@jagdpanzerIV.localdomain> <20170829211046.74644c8a@gandalf.local.home> <1504057959.2786.4.camel@perches.com> <20170830022528.GA17968@jagdpanzerIV.localdomain> <1504060296.2786.8.camel@perches.com> <20170830024703.GA17175@jagdpanzerIV.localdomain> <20170905094452.GE8741@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170905094452.GE8741@pathway.suse.cz> User-Agent: Mutt/1.9.0 (2017-09-02) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (09/05/17 11:44), Petr Mladek wrote: [..] > > Tetsuo wants this, for instance, > > for OOM reports and backtraces. SCIS/ATA people want it as well. > > The mixing of related lines might cause problems. But I am not sure > if it can be fixed a safe way on the printk side. Especially I am > afraid of an extensive buffering. > > My underestanding, of the discussion about printk kthread patchset, > is that printk() has the following priorities this discussion is not related to printk ktrehad. it's just the first messages was posted as a reply to printk kthread patch set, other than that it's unrelated. > Any buffering would delay showing the message. It increases > the risk that nobody will see it at all. It is acceptable > in printk_safe() and printk_safe_nmi() because we did not > find a better way to avoid the deadlock. that's why I want buffered printk to re-use the printk-safe buffer on that particular CPU [ if buffered printk will ever land ]. printk-safe buffer is not allocated on stack, or kmalloc-ed for temp usafe, and, more importantly, we flush it from panic(). and I'm not sure that lost messages due to missing panic flush() can really be an option even for a single cont line buffer. well, may be it can. printk has a sort of guarantee that messages will be at some well known location when pr_foo or printk function returns. buffered printk kills it. and I don't want to have several "flavors" of printk. printk-safe buffer seems to be the way to preserve that guarantee. -ss