From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756395AbcC2JON (ORCPT ); Tue, 29 Mar 2016 05:14:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:51296 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751282AbcC2JOL (ORCPT ); Tue, 29 Mar 2016 05:14:11 -0400 Date: Tue, 29 Mar 2016 11:14:39 +0200 From: Jan Kara To: Sergey Senozhatsky Cc: Andrew Morton , Jan Kara , Petr Mladek , Tejun Heo , Tetsuo Handa , linux-kernel@vger.kernel.org, Byungchul Park , Sergey Senozhatsky , Jan Kara Subject: Re: [RFC][PATCH v8 1/2] printk: Make printk() completely async Message-ID: <20160329091439.GC12993@quack.suse.cz> References: <1458834203-3392-1-git-send-email-sergey.senozhatsky@gmail.com> <1458834203-3392-2-git-send-email-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458834203-3392-2-git-send-email-sergey.senozhatsky@gmail.com> 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 Fri 25-03-16 00:43:22, Sergey Senozhatsky wrote: > @@ -1655,6 +1670,14 @@ asmlinkage int vprintk_emit(int facility, int level, > raw_spin_lock(&logbuf_lock); > logbuf_cpu = this_cpu; > > + /* > + * Set printing kthread sleep condition early, under the > + * logbuf_lock, so it (if RUNNING) will go to console_lock() > + * and spin on logbuf_lock. > + */ > + if (!in_panic && printk_kthread && !need_flush_console) > + need_flush_console = true; > + > if (unlikely(recursion_bug)) { > static const char recursion_msg[] = > "BUG: recent printk recursion!"; I like the cleaned up need_flush_console handling! Just a suggestion: It may be more logical to handle need_flush_console setting under logbuf_lock but after we actually store the message in the buffer, not before. Doesn't matter for correctness now but may be more future-proof. Honza -- Jan Kara SUSE Labs, CR