From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f65.google.com ([74.125.83.65]:42637 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbeF1CQI (ORCPT ); Wed, 27 Jun 2018 22:16:08 -0400 Date: Thu, 28 Jun 2018 11:16:03 +0900 From: Sergey Senozhatsky To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Peter Zijlstra , Tetsuo Handa , Sergey Senozhatsky , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 2/3] printk: Create helper function to queue deferred console handling Message-ID: <20180628021603.GB481@jagdpanzerIV> References: <20180627140817.27764-1-pmladek@suse.com> <20180627140817.27764-3-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180627140817.27764-3-pmladek@suse.com> Sender: stable-owner@vger.kernel.org List-ID: On (06/27/18 16:08), Petr Mladek wrote: > -int vprintk_deferred(const char *fmt, va_list args) > +void defer_console(void) > { > - int r; > - > - r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, 0, fmt, args); > - > preempt_disable(); > __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT); > irq_work_queue(this_cpu_ptr(&wake_up_klogd_work)); > preempt_enable(); > +} > + > +int vprintk_deferred(const char *fmt, va_list args) > +{ > + int r; > + > + r = vprintk_emit(0, LOGLEVEL_SCHED, NULL, 0, fmt, args); > + defer_console(); > > return r; You can just call vprintk_emit(LOGLEVEL_SCHED) from vprintk_func(), then you don't need to factor out vprintk_deferred() and vprintk_emit(). Any reason for that split? I'd also may be prefer to have a bit different name. I'm talking about defer_console(). Other than that Acked-by: Sergey Senozhatsky -ss