Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp575611img; Tue, 26 Feb 2019 05:13:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IbFw5EtP3CRyxjxUDb/chbWhR0a+1ZVJsqL/r8rv/+s/Q8S9TyPeUkMPSMKcY9iDZ4qrJHO X-Received: by 2002:a17:902:64:: with SMTP id 91mr26789918pla.229.1551186803566; Tue, 26 Feb 2019 05:13:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551186803; cv=none; d=google.com; s=arc-20160816; b=SIkfSrsg/uw4Mbqmtfb0fYfnRqZux1FnvVSDd00xZ4WX8S+XQ/pomUxjHqO+OepVzl UCTm2AfIeWzb9Xkk1LPHjz87cMVYOhVTBH+o+saYd78mf6m4vfFSOFyeusO00U0gw5uL 7J14rHI8Vnd6RFBH0WMROBL9UHXjd0+lqG1S7gszE1Bm1W1UGsufPRs/TxI1YuXIIFHd te/Wx12tEC0e+/axjijRAtBt2DibCAmf/QKWtKZ7VwHIIfWAffDBV63s5nyna68W/HFe kiTrsFp8kyIMa5x4zWaK1C+2QWK7EDGTVfegpXLmheXj1SCcyQ0ELjGrhghsu1SXRdqu G7RQ== 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; bh=W2IGoO03FOYSkJdK+hbEbl6DQXeQjWZ4NvudqiAQ3+A=; b=bddWTDCKF1oMyyB2cMEtSfLYmbXkNWo1tDIvLFy0Gjn9v31Y8LPSXw4xQ5dq2yHLaf OW5gZHK86QkxrMPiaz83bM8mgGYbI5gRixw6GqOehfDrm/jzLMEQ+TWHZxJ8cId2LMW8 i5ICBsLD/Qy5ZLslbVXAn2yHHm0gz7hL+ve8a4F1rOgVvI15ATpOVxWJ6LU597r/i99A qvvApICxAoWen1ccgM6u5RqWBqiGRYpcoyG+WcT+ArUbLEgkCfFgrGVhMWlR2uve4WIJ WGvQDdFJYVdK6H3dvqOFdL8Okj5vuAFKme+ToHkcuzI3Ok3ziCclhqmUse0MntlE4uvg mT/A== 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 e67si13202222pfh.212.2019.02.26.05.13.07; Tue, 26 Feb 2019 05:13:23 -0800 (PST) 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 S1726576AbfBZNLL (ORCPT + 99 others); Tue, 26 Feb 2019 08:11:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:46620 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725954AbfBZNLL (ORCPT ); Tue, 26 Feb 2019 08:11:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B1458AF72; Tue, 26 Feb 2019 13:11:09 +0000 (UTC) Date: Tue, 26 Feb 2019 14:11:08 +0100 From: Petr Mladek To: John Ogness Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Sergey Senozhatsky , Steven Rostedt , Daniel Wang , Andrew Morton , Linus Torvalds , Greg Kroah-Hartman , Alan Cox , Jiri Slaby , Peter Feiner , linux-serial@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC PATCH v1 13/25] printk: track seq per console Message-ID: <20190226131108.rr5komehfqitg6di@pathway.suse.cz> References: <20190212143003.48446-1-john.ogness@linutronix.de> <20190212143003.48446-14-john.ogness@linutronix.de> <20190225145954.62zl3tndmo2t372h@pathway.suse.cz> <87lg230whd.fsf@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lg230whd.fsf@linutronix.de> 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 2019-02-26 09:45:02, John Ogness wrote: > On 2019-02-25, Petr Mladek wrote: > >> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > >> index ece54c24ea0d..ebd9aac06323 100644 > >> --- a/kernel/printk/printk.c > >> +++ b/kernel/printk/printk.c > >> @@ -1504,6 +1514,19 @@ static void call_console_drivers(const char *ext_text, size_t ext_len, > >> if (!cpu_online(raw_smp_processor_id()) && > >> !(con->flags & CON_ANYTIME)) > >> continue; > >> + if (con->printk_seq >= seq) > >> + continue; > >> + > >> + con->printk_seq++; > >> + if (con->printk_seq < seq) { > >> + print_console_dropped(con, seq - con->printk_seq); > >> + con->printk_seq = seq; > > > > It would be great to print this message only when the real one > > is not superseded. > > You mean if there was some function to check if "seq" is the newest > entry. And only in that situation would any dropped information be > presented? Not newest but not suppressed. Example: Only every 10th message is important enough to reach console (see suppress_message_printing). Instead of seeing: message 10 message 20 7 messages dropped 20 another messages dropped because of printing the warning 20 another messages dropped because of printing the warning 20 another messages dropped because of printing the warning message 100 see something like: message 10 message 20 13 messages dropped message 40 13 messages dropped message 60 13 messages dropped message 80 message 90 message100 The original code would print only warnings because the important lines are lost when printing the warnings. A better code would show more messages because the warning is printed when a visible message is already buffered. You might wonder why there are only 13 messages dropped in the new state. It is because the other 6 messages are quickly read and suspended (filtered out). They are skipped by intention. I hope that it will be more clear with the patch that I have just sent, see https://lkml.kernel.org/r/20190226124945.7078-1-pmladek@suse.com Best Regards, Petr