From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756403AbcHYVeJ (ORCPT ); Thu, 25 Aug 2016 17:34:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:51563 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754321AbcHYVeF (ORCPT ); Thu, 25 Aug 2016 17:34:05 -0400 Date: Thu, 25 Aug 2016 23:33:33 +0200 From: Petr Mladek To: Sergey Senozhatsky Cc: Sergey Senozhatsky , Jan Kara , Kay Sievers , Tejun Heo , Calvin Owens , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH][RFC] printk: make pr_cont buffer per-cpu Message-ID: <20160825213333.GC2273@dhcp128.suse.cz> References: <20160822154030.2715-1-sergey.senozhatsky@gmail.com> <20160823051831.GA423@swordfish> <20160823114702.GC4866@pathway.suse.cz> <20160824011420.GA452@swordfish> <20160824081919.GE2504@pathway.suse.cz> <20160824142729.GA579@swordfish> <20160825212740.GB2273@dhcp128.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160825212740.GB2273@dhcp128.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2016-08-25 23:27:40, Petr Mladek wrote: > On Wed 2016-08-24 23:27:29, Sergey Senozhatsky wrote: > > On (08/24/16 10:19), Petr Mladek wrote: > > > > On (08/23/16 13:47), Petr Mladek wrote: > > > > [..] > > > > > > if (!(lflags & LOG_NEWLINE)) { > > > > > > + if (!this_cpu_read(cont_printing)) { > > > > > > + if (system_state == SYSTEM_RUNNING) { > > > > > > + this_cpu_write(cont_printing, true); > > > > > > + preempt_disable(); > > > > > > + } > > > > > > + } > > > > > > > > > > I am afraid that this is not acceptable. It means that printk() will have > > > > > an unexpected side effect. The missing "\n" at the end of a printed > > > > > string would disable preemption. See below for more. > > > > > > > > missing '\n' must WARN about "sched while atomic" eventually, so it > > > > shouldn't go unnoticed or stay hidden. > > > > > > Well, it will still force people to rebuilt a test kernel because they > > > forget to use '\n" and the test kernel is unusable. > > > > you are right. misusage of printk() will now force user to go and fix > > it. the kernel most likely will be rebuilt anyway - there is a missing > > \n after all. > Of course, it would be great to fix it transparently. But if there must > be a burden, I would prefer to keep it on the "corner" case users > rather than to push it on everyday users. Not to say that a messed log is much less painful than a locked system. Best Regards, Petr