From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934006AbcCPH4w (ORCPT ); Wed, 16 Mar 2016 03:56:52 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:34056 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933203AbcCPH4v (ORCPT ); Wed, 16 Mar 2016 03:56:51 -0400 Date: Wed, 16 Mar 2016 16:56:05 +0900 From: Sergey Senozhatsky To: Byungchul Park Cc: Sergey Senozhatsky , Sergey Senozhatsky , Jan Kara , Andrew Morton , Jan Kara , Petr Mladek , Tejun Heo , Tetsuo Handa , linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Message-ID: <20160316075605.GE3217@swordfish> References: <1457964820-4642-1-git-send-email-sergey.senozhatsky@gmail.com> <1457964820-4642-2-git-send-email-sergey.senozhatsky@gmail.com> <20160315100323.GF17942@quack.suse.cz> <20160315140738.GA773@swordfish> <20160316053944.GJ5220@X58A-UD3R> <20160316065851.GC3217@swordfish> <20160316073007.GL5220@X58A-UD3R> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160316073007.GL5220@X58A-UD3R> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (03/16/16 16:30), Byungchul Park wrote: > > Do you mean the wake_up_process() in console_unlock? no, I meant wake_up_process(printk_kthread), the newly added one. -- if we are going to have wake_up_process() in wake_up_klogd_work_func(), then we need `in_sched' message to potentially trigger a recursion chain wake_up_klogd_work_func()->wake_up_process()->printk()->wake_up_process()->printk()... to break this printk()->wake_up_process()->printk(), we need wake_up_process() to be under the logbuf lock; so vprintk_emit()'s if (logbuf_cpu == this_cpu) will act. -- if we are going to have wake_up_process() in console_unlock(), then console_unlock()->{up(), wake_up_process()}->printk()->{console_lock(), console_unlock()}->{up(), wake_up_process()}->printk()... is undetectable... by the time console_unlock() calls wake_up_process() there are no printk() locks that this CPU owns. > I said they should be kept *out of* the critical section. :-) > Otherwise, it can recurse us forever. can you explain? -ss