Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5022894imm; Tue, 19 Jun 2018 03:53:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKBLhu0hVC2msjv3OvONZKyjFvErLX4UtXvqLn71da4F+WxC0hCsGDgw2LxwPR0t6xtYiGS X-Received: by 2002:a62:5788:: with SMTP id i8-v6mr17368379pfj.175.1529405592068; Tue, 19 Jun 2018 03:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529405592; cv=none; d=google.com; s=arc-20160816; b=RHawxAjh9ZrK5VVuzjtL4zP4XHf+I2zW4DmSPwa6/vBVvWigOMebxYRqs70WUFRl9a 54irmaPxKylAWK+M47YzsyVOBCuVluMe65LCGw/RClLVH+moUk7NueLeM79zKBnQxeOT 3E7eZgKXta5taUf3gzOVAzQdGrHNuc5MQ431gIhFFsvKDS9+w4J01caT3hKYLbSgLy5Y R946PDVJvJAg4wUr1lVnSluHvyDI6YcQtol669PTvkvkMVp9YuQz7rfpVx6ZxhNcilri oA2/kMV8LoAfjta/bSH/pmvyd6GhTKBiP0zCK1e86GzuRIUJg8Gh1SSr53vJ7WkpBcYJ TQPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Q27olnHdDND0oyiiuQJhCvuKCGnfhBhvl/2Yc82ok8I=; b=Iw47XBqpvZTWlxI7frLnTAxy5L/YszgvuCkW2zLS0I9XWKtUWEFKJMOR8qcmxbVjwe vX2MT6tqRzWrLD7pXSa6I/Gao/w0kDBiNNeSVidP6Ly53rY5RaqSw+yMiGkdGzOzAVI9 JV5w//MXHbOk/YqlYjGBWd2EbExPpbhJ/GG+MDmsEw3wt/ybaHDEYETAfDv3RWwgkS6n Ymrz0mhdRHN7ps10uptleoo8AO37J/D/L1bQa8vXWfehbCU1hIwigW2388HUPHzU8n6J YNJpVebl2L8heIvwEXSd/VnLmU+UTdM0vtDdTifm1lIM+bmSM2EWzwr15uXxNnZERwoS rpdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d65-v6si13912883pgc.70.2018.06.19.03.52.57; Tue, 19 Jun 2018 03:53:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937631AbeFSKwT (ORCPT + 99 others); Tue, 19 Jun 2018 06:52:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:55130 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936108AbeFSKwQ (ORCPT ); Tue, 19 Jun 2018 06:52:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 997ECAC84; Tue, 19 Jun 2018 10:52:14 +0000 (UTC) Date: Tue, 19 Jun 2018 12:52:13 +0200 From: Petr Mladek To: Sergey Senozhatsky Cc: Maninder Singh , sergey.senozhatsky@gmail.com, rostedt@goodmis.org, linux-kernel@vger.kernel.org, a.sahrawat@samsung.com, pankaj.m@samsung.com, v.narang@samsung.com Subject: Re: [PATCH v2] printk: make sure to print log on console. Message-ID: <20180619105213.uzf6ba3oo3475icz@pathway.suse.cz> References: <20180601090029epcas5p3cc93d4bfbebb3199f0a2684058da7e26~z-a_jkmrI2993329933epcas5p3q@epcas5p3.samsung.com> <20180618061550.GA27996@jagdpanzerIV> <20180618062306.GA29683@jagdpanzerIV> <20180619093244.ehj34uhpnpv6447f@pathway.suse.cz> <20180619094953.GB2631@jagdpanzerIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180619094953.GB2631@jagdpanzerIV> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 2018-06-19 18:49:53, Sergey Senozhatsky wrote: > On (06/19/18 11:32), Petr Mladek wrote: > > > - if (suppress_message_printing(msg->level)) { > > > + if (!ignore_loglevel && (msg->flags & LOG_NOCONS)) { > > > > > > > > > `ignore_loglevel' is a module param and can change any time via > > > /sys/module/printk/parameters/ignore_loglevel > > > we need to respect its value. > > > > I would prefer to keep the patch as is. I see it the following way. > > > > Also console_loglevel can be changed anytime by /proc/sys/kernel/printk. > > The patch basically moves the decision about the message visibility from > > console_unlock() to vprintk_emit(). The logic is easier when all > > aspects are handled in a single location and only once. > > But when I set /sys/module/printk/parameters/ignore_loglevel I naturally > expect it to take an immediate action. Without waiting for the consoles > to catch up and to discard N messages [if the consoles were behind the > logbuf head]. Yeah, I understand this view. I thought about it as well. But did you ever needed this behavior in the real life? I personally changed ignore_loglevel only before I wanted to reproduce a bug. Then it would be perfectly fine to handle it only in vprintk_emit(). In fact, it would be even better because it would affect only messages that happened after I triggered the bug. Anyway, changing ignore_loglevel during a printk flood has undefined behavior by definition. If you do this manually, it would depend on the speed of the console, your typing capabilities, possibility to login as administrator, load of the system, ... If you do this by a script, you would probably do it in advance. I do not see this a reason for a more complicated and even schizophrenic logic. Best Regards, Petr