Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163836AbdAIQ42 (ORCPT ); Mon, 9 Jan 2017 11:56:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:43529 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967079AbdAIQ41 (ORCPT ); Mon, 9 Jan 2017 11:56:27 -0500 Date: Mon, 9 Jan 2017 17:56:23 +0100 From: Petr Mladek To: Sergey Senozhatsky Cc: Andrew Morton , Steven Rostedt , Peter Hurley , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH 2/2] printk: always report lost messages on serial console Message-ID: <20170109165623.GE20785@pathway.suse.cz> References: <20161224140902.1962-1-sergey.senozhatsky@gmail.com> <20161224140902.1962-3-sergey.senozhatsky@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161224140902.1962-3-sergey.senozhatsky@gmail.com> 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-12-24 23:09:02, Sergey Senozhatsky wrote: > The "printk messages dropped" report is 'attached' to a kernel > message located at console_idx offset. This does not work well > if we skip that message due to loglevel filtering, because in > this case we also skip/lose dropped message report. > > Disable suppress_message_printing() loglevel filtering if we > must report "printk messages dropped" condition. I have looked at this once again. Please, do you have a real-life example when the "printk messages dropped" was not printed? I ask because the original code looks like this this: if (console_seq < log_first_seq) { console_seq = log_first_seq; console_idx = log_first_idx; skip: if (console_seq == log_next_seq) break; msg = log_from_idx(console_idx); if (suppress_message_printing(msg->level)) { console_idx = log_next(console_idx); console_seq++; goto skip; } console_idx = log_next(console_idx); console_seq++; raw_spin_unlock(&logbuf_lock); By other words, the search for a visible message is finished when we find one or when the entire log buffer is checked. As a consequence, the warning about "printk messages dropped" is lost _only_ when there was no visible message in the entire buffer. Therefore, the warning might get lost only when the log buffer was very small or when console_level filter was too restricting. I wonder if this is a case for a real user or a real life. In each case, such a scenario most likely comes from a very curious setup. It is possible that your fix is fine. If we lose messages, we are screwed anyway. But I still have problems to accept that we would start printing less important messages (that would normally be ignored) in situation when we have troubles to print the more important ones. This logic rings warning bells in my head and this is why I suggest more conservative solution and ask the many questions. Am I so wrong in my thinking, please? Best Regards, Petr