From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933413AbcCNEps (ORCPT ); Mon, 14 Mar 2016 00:45:48 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:34517 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932544AbcCNEpp (ORCPT ); Mon, 14 Mar 2016 00:45:45 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Mon, 14 Mar 2016 13:45:36 +0900 From: Byungchul Park To: Sergey Senozhatsky Cc: akpm@linux-foundation.org, mingo@kernel.org, linux-kernel@vger.kernel.org, akinobu.mita@gmail.com, jack@suse.cz, peter@hurleysoftware.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org Subject: Re: [PATCH v6 1/2] printk: Factor out buffering and irq work queuing in printk_deferred Message-ID: <20160314044536.GG5220@X58A-UD3R> References: <1457692627-14076-1-git-send-email-byungchul.park@lge.com> <1457692627-14076-2-git-send-email-byungchul.park@lge.com> <20160314012157.GA8074@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160314012157.GA8074@swordfish> 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 Mon, Mar 14, 2016 at 10:21:57AM +0900, Sergey Senozhatsky wrote: > Hello Byungchul, > > Sorry, I'll make sure I Cc you next time. Jan Kara's updated patch set > > http://marc.info/?l=linux-kernel&m=145787625506342 Hello Sergey, It would be appreciated if you or Jan Cc me from now. > > it's quite close to what you have done in this patch, but Jan's > patch also solves a number of more likely to happen cases. > > have time to take a look? I checked it now. I hope it will be accepted, then I can work mine based on the Jan's patch. > > the lock debug patch in your series is different. can we settle > down async printk first and then return to it? it's not so simple... > > > On (03/11/16 19:37), Byungchul Park wrote: > [..] > > int printk_deferred(const char *fmt, ...) > > { > > va_list args; > > int r; > > > > preempt_disable(); > > + > > va_start(args, fmt); > > - r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, 0, fmt, args); > > + r = vprintk_deferred(fmt, args); > > va_end(args); > > + printk_pending_output(); > > > > - __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT); > > - irq_work_queue(this_cpu_ptr(&wake_up_klogd_work)); > > preempt_enable(); > > > > return r; > > vprintk_deferred() does vprintk_emit()->{spin_lock()} again? cosole_lock() is > moved out of sight, but logbug_lock is still there. wouldn't this (in the worst We have to ensure the critical section by logbug_lock will not call printk() or try to obtain the lock again. Current code works well in those regards. logbuf_lock is not the thing we have to care when considering the problem this patch deal with. What do you think? > case) result in endless loop after all? sorry if I'm missing something. As long as we ensure it, the endless loop by logbuf_lock cannot happen. > > -ss