Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp4554672imc; Mon, 25 Feb 2019 07:00:35 -0800 (PST) X-Google-Smtp-Source: AHgI3IYFDarnHE1+TdTUWs89guFas4joEQR9vnsLrhiX9CiYlGwjzLnjwIlODFulv+vDq4ZTPfcs X-Received: by 2002:a65:5c41:: with SMTP id v1mr15083772pgr.404.1551106835409; Mon, 25 Feb 2019 07:00:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551106835; cv=none; d=google.com; s=arc-20160816; b=RBjju0UgVh0t71aZ6SfCiQ8TN1K0PPVb8flY3Ze0keDsf2rwDT4oQl5LHkA0C+OquW 0zyaw65fXSOivcLl9necbB8h6v8vUhkMGewt5rYb98bvhkG4T4ZvIPqDvZY5pUqdvMME G+I11Tl4mUffHFho44emPYZJyUX3JIWFALw47Wl7lkEXRpP1mo+vgiqjKEJxfBZPy91H ldO8PqXBOJTM1gd3pj8XTAK0pRYhZ/jtw+XNY9N/qkmHldY/PPpXYDOVHcdbBMfMa6UI O0k4j/L2G9rfrKrDtrdZg+W87plXwuHSMnWcNe1nscWb73dBtlxarfVjri0MeD+jwEGo tG0Q== 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=tU41gUV2ilZr+U449lQHU1uAW8TnmAZZ7GSeY012fXY=; b=Amxtbx6N7hoPQ0a5WxgGwoWfvj5YO28lE2bUjFOMzbSPdvH87FM12Qo5v1hPk0WL0X w1rfLw7Z+mAUSn4YUBvyzU7vk3zLvsHh+B2orhsXLfuB59Tu0jbR7r/PgEnSogJXL3zE hiAQE0IMrUlXiBHX6i7bTa8Ra0kB8TEe780+0nKiU7W5mN7erwGthnti/TuZJ7YHB+G7 Sh7XhOA0JojtWyrhKFCPYiHV/aRdanNUEeMJmb35S0Iv6FfFbwODNVQwF5qse3Bgat/2 RxwG9SnJXI+kU8bv7W96+h5l5VdThsB03zXrT0Rf3IdASVcrk26f0BplJC0n5Q59eZuL rfAg== 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 i3si9476669plt.120.2019.02.25.07.00.18; Mon, 25 Feb 2019 07:00:35 -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 S1727529AbfBYO75 (ORCPT + 99 others); Mon, 25 Feb 2019 09:59:57 -0500 Received: from mx2.suse.de ([195.135.220.15]:34046 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727443AbfBYO75 (ORCPT ); Mon, 25 Feb 2019 09:59:57 -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 D4666AC81; Mon, 25 Feb 2019 14:59:55 +0000 (UTC) Date: Mon, 25 Feb 2019 15:59:54 +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: <20190225145954.62zl3tndmo2t372h@pathway.suse.cz> References: <20190212143003.48446-1-john.ogness@linutronix.de> <20190212143003.48446-14-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190212143003.48446-14-john.ogness@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-12 15:29:51, John Ogness wrote: > Allow each console to track which seq record was last printed. This > simplifies identifying dropped records. I would like to see a better justification here. And I think that it is part of this patchset. One reason is to implement console reply a cleaner way. Another reason is to allows calling lockless consoles directly in emergency situations. Both reasons are independent on the log buffer implementation. Therefore I suggest to move it into another patchset. > 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. 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. Heh, there is a bug in the current code. The warning is not printed when the currently proceed message is superseded. I am going to prepare a patch for this. Best Regards, Petr