From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751817AbcF0J0t (ORCPT ); Mon, 27 Jun 2016 05:26:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:50411 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbcF0J0r (ORCPT ); Mon, 27 Jun 2016 05:26:47 -0400 Date: Mon, 27 Jun 2016 11:26:45 +0200 From: Petr Mladek To: Sergey Senozhatsky Cc: Sergey Senozhatsky , Andrew Morton , Tejun Heo , Jan Kara , Calvin Owens , linux-kernel@vger.kernel.org Subject: Re: [PATCH] printk: introduce should_ignore_loglevel() Message-ID: <20160627092645.GK29718@pathway.suse.cz> References: <20160623163302.761-1-sergey.senozhatsky@gmail.com> <20160624160533.GI29718@pathway.suse.cz> <20160625052237.GA580@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625052237.GA580@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 Sat 2016-06-25 14:22:37, Sergey Senozhatsky wrote: > On (06/24/16 18:05), Petr Mladek wrote: > [..] > > > +static bool should_ignore_loglevel(int level) > > > +{ > > > + return (level >= console_loglevel && !ignore_loglevel); > > > > The patch looks fine. It is nice optimization. > > > > I was just quite confused by the name of this function. A function > > called should_ignore_loglevel() should not return false when > > ignore_loglevel variable is true. > > > > I would call it ignore_message() or ignore_message_on_console() or so. > > Hello Petr, you are right. > > I was thinking about > > s/should_ignore_loglevel/suppress_message/g > or.... s/should_ignore_loglevel/suppress_message_by_level/g > s/should_ignore_loglevel/suppress_message_printing/g > > suppress_message_printing() is probably fine. All variants look fine to me. After renaming, feel free to add: Reviewed-by: Petr Mladek Best Regards, Petr PS: The ignore_loglevel handling is a bit racy in some situations. For example, uv_nmi_dump_state() or __handle_sysrq() set another level, print some messages, and restore the original level. They do not wait until all the printed messages appear on the console. Also they do not synchronize against each other. I am not sure if we have already discussed this. It is not critical and it works well most of the time. I just want to make sure that you know about it as you have more plans with the printk/console code.