Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp344071img; Tue, 26 Feb 2019 00:45:56 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib0cPMCvPD9CQarepuEE3+7MqT6swWx4Ah6sXU8U+gmryuhHM/E7DOb55/wqNF37QFewwE0 X-Received: by 2002:a17:902:9008:: with SMTP id a8mr25150671plp.38.1551170756374; Tue, 26 Feb 2019 00:45:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551170756; cv=none; d=google.com; s=arc-20160816; b=TvqB0sMr+CWG4bRtWOCCccYWfz5zyPKjALYwqcaujIv16X1oLBnPD6UlR7qXat0RHq pIbBOHvmYQ5M91Z9fAhuXmyaRtBzvds9/Qmd4zq35m9HgeFA3SjbTvFJKRZ+17T/RBeg FbTggLpdWJBiz2w6dX+PudhHlFwW4fwScH763nobsrs+Gx7K/uVSaUhCs1VQdnLZwqPm AdMITzeDbBnZikl6HDa1hO3Xu4uJvkju/yUgUuRcelLYxPWKDDObWKV/QfYE5gRCokek xF+xVUOKIkhu79WZzvLMTjdeNz6A0nK4sIuc/4gWok+DdTWrIdplC3hvRjMETN9n+oWX bAZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=yjCCANtlGBKif/rky497OHqPqS+kMEfS6H92XtS397s=; b=MP/mGjnyBDHwpGMvQfUWc/6sqh3xgbTcqYDma8wJ4Ii4sjum0MzXg7GkmKdkT2Kr4F TrnrGzpyU3KoCVK5NRBEQ/Fet5/aqrtfDANrzdk10cgWfOabUznEgKyOP+zjIF5TGGhw ZzfnpicI4YPetTn0sOMRZVbnaJfT1HTJMa8q83tXAtdopjBkx8FRFLIGPDbvd8AdhZov fUs5N870xesJVRCEGyd97O4mESe84+4ZTB1ZcT/iEFc/onNoovvVgqPPEIV45ywKODwn leiqGgf6hxqUmgV5sR47Kx0svFcEvSfUjQKw4/WZnSjBoft3bk9aQMAH/cht0K9N4e/i zGLg== 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 l16si11771932pgh.509.2019.02.26.00.45.41; Tue, 26 Feb 2019 00:45:56 -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 S1727135AbfBZIpO (ORCPT + 99 others); Tue, 26 Feb 2019 03:45:14 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:43848 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725941AbfBZIpN (ORCPT ); Tue, 26 Feb 2019 03:45:13 -0500 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1gyYMK-0002Ky-CT; Tue, 26 Feb 2019 09:45:04 +0100 From: John Ogness To: Petr Mladek 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 References: <20190212143003.48446-1-john.ogness@linutronix.de> <20190212143003.48446-14-john.ogness@linutronix.de> <20190225145954.62zl3tndmo2t372h@pathway.suse.cz> Date: Tue, 26 Feb 2019 09:45:02 +0100 In-Reply-To: <20190225145954.62zl3tndmo2t372h@pathway.suse.cz> (Petr Mladek's message of "Mon, 25 Feb 2019 15:59:54 +0100") Message-ID: <87lg230whd.fsf@linutronix.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > The suppressed messages can be proceed quickly. They allow consoles > to catch up with the message producers. But if the spend time > with printing the warning, we just risk loosing more messages > again and again. So instead of: message A message B 3 messages dropped message F message G 2 messages dropped message J message K you would prefer to see: message A message B message F message G message J message K 5 messages dropped ... with the hope that maybe we are able to print messages H and/or I by not spending time on the first dropped message? If there are a lof printk's coming (sysrq-z) then probably there will be many dropped during output. With your proposal, it wouldn't be seen that so many intermediate messages are dropped. Only at the end of the output the user is presented with some huge dropped number. With my implementation if you see 2 printk lines together you can be sure that nothing was dropped between those two lines. I think that is more valuable than having the possibility of maybe losing a few less messages in a flood situation. John Ogness