Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2233875pxp; Mon, 21 Mar 2022 14:32:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+c6lacMFPi7kolwXwCIKy7bNFn2WVI475WtQfdl2v1hXTicue/GmnslHF/eUR9qdzY5td X-Received: by 2002:a17:903:41d1:b0:153:b1ac:a25f with SMTP id u17-20020a17090341d100b00153b1aca25fmr14837514ple.69.1647898339727; Mon, 21 Mar 2022 14:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647898339; cv=none; d=google.com; s=arc-20160816; b=y5/yoLsonjePhxpH91lavvibTVlNG0eXlYigjyxXuwvdvb8Vear9l9CRuzEe+ooGcf f+BPjBVaWe02CGg6eMPPxZy0jzJ2iJsyjIlhOBqX+CG0Doe30SV8iBpk0KoESaVDqGhu uaTXJThM31bsy8Ces9JU0Ogv+OxBzwUtMkP6pI1bFHm16lAurV+F9ZCXV2cFJ3065rHm b5XkMcwxBGm9u0kIf/hcGR/GplqJEAjz4f6bHWczbrt4QfZO3KdDNdtTZBEe/wSqyrWD 6ArdmXoBowaP4b+46AwnDWYGLR3wbDoUmwCnJXQtd2Bu2cfUJRCVaN3pqOLbftIXa0xF z3pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=YfZJhnFFE47+r6x4/y12Et9mQlf31S6cyLCttG7V3Hg=; b=UTVIL+FGG2TOuH7H40XUUuu1m71kSR7ps1BvaO3hp7kOchs3qtzG6Qwa45p2K1JvAW oLWcB1rbs+wLtsS0qyzszXmbKQXwnXH2AoJxLwZFM8gVQh10Ah+masWfPTARCWV5a5oV os38q02j6PM4fM6/QTgFyuSi29wUMa1KHVxVTHo7VxKV53NzgMehe8iUYttU458edD+Z LaA4V30hjwwGhgXhTzVQfVsbnvM0mBee8NGTSqNoAORFSNR/Y48rkozf1cfVmyS5wF7O P2lxt+i7CWS9zdcbDYEVE8Msk5XxBOkJcvKY4ZdmQwcoCeu+refzJcKtbACNHKiUdvXv gB3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=slMFIokG; dkim=neutral (no key) header.i=@linutronix.de; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h9-20020a170902b94900b00153bd1573c1si11556382pls.85.2022.03.21.14.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 14:32:19 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=slMFIokG; dkim=neutral (no key) header.i=@linutronix.de; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 60DE9224536; Mon, 21 Mar 2022 14:11:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345915AbiCUJdM (ORCPT + 99 others); Mon, 21 Mar 2022 05:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238396AbiCUJdK (ORCPT ); Mon, 21 Mar 2022 05:33:10 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD39F554BF; Mon, 21 Mar 2022 02:31:44 -0700 (PDT) Date: Mon, 21 Mar 2022 10:31:42 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1647855103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YfZJhnFFE47+r6x4/y12Et9mQlf31S6cyLCttG7V3Hg=; b=slMFIokGRhs/PDaoq0WKr5va3xvP6cZXpwJGhaXFVAtqnCSE7/sPBtEl5AEn9eio/5pSTp xomX0cA5lo0vZWThBX8Ej30PWPZCwUFFwjfzjo47ccJma3D0t274QAaZqJMfcgMt3oyeGo BohAEcFhk4iJcFeWnb6DvDv+NJQ0Edm73IaqyeVpJ2tmA0nZmq3zPBSYnx37cNQLpfziA0 eb47m29ERJdVDQJ496ODexHpaIcS4aYOJbxcHBsmzWXAvLdEAPA+Kione/z0MxIteC0HZa WsUj8q5PuMsSWSaQ7MjeUHNpb8etaBoa0kdbNfIX4xCLhPhrfV82Le+7UrV3sQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1647855103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YfZJhnFFE47+r6x4/y12Et9mQlf31S6cyLCttG7V3Hg=; b=8BdkzvmmWaoe90eyw+hphvDhdeRamHpxmFFnEi/fEfgzeCnYzg3mpMZfgr/9VEwmV7nNfy /WW9zUYJXae8xIAg== From: Sebastian Andrzej Siewior To: Schspa Shi Cc: pmladek@suse.com, sergey.senozhatsky@gmail.com, rostedt@goodmis.org, john.ogness@linutronix.de, linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de Subject: Re: [PATCH 5.10-rt] printk: fix suppressed message print when reboot/panic Message-ID: References: <20220321053815.71316-1-schspa@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220321053815.71316-1-schspa@gmail.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-03-21 13:38:16 [+0800], Schspa Shi wrote: > Update printk_seq for suppressed message. > > Affects 5.9-rt and 5.10-rt > > When message is suppressed, printk_seq should be updated, otherwise > this message will be printed when reboot. This problem was introduced > in commit 3edc0c85d154 ("printk: Rebase on top of new ring buffer"). So it is only 5.10 given that 5.9 is not maintained. That commits points to the printk update in v5.9.1-rt18. John? > Signed-off-by: Schspa Shi > --- > kernel/printk/printk.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index 0c56873396a9..f68c4ba7eb4d 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -2826,8 +2826,17 @@ static int printk_kthread_func(void *data) > if (!(con->flags & CON_ENABLED)) > continue; > > - if (suppress_message_printing(r.info->level)) > + printk_seq = atomic64_read(&con->printk_seq); > + > + if (suppress_message_printing(r.info->level)) { > + /* > + * Skip record we have buffered and already printed > + * directly to the console when we received it, and > + * record that has level above the console loglevel. > + */ > + atomic64_cmpxchg_relaxed(&con->printk_seq, printk_seq, seq); > continue; > + } > > if (con->flags & CON_EXTENDED) { > len = info_print_ext_header(ext_text, > @@ -2843,7 +2852,6 @@ static int printk_kthread_func(void *data) > printk_time); > } > > - printk_seq = atomic64_read(&con->printk_seq); > > console_lock(); > console_may_schedule = 0; > -- > 2.29.0 >