From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE87136C9EB for ; Fri, 12 Jun 2026 18:52:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781290368; cv=none; b=a+jTf7WHPctzc/d/r1+vUf8Q52wbV9Pj6XXlYhAnxPG4F+/6j+a4VXcYCFKooUR6dBdQ6IY2ZBoBgeaZaQAdufb2wOi1vi7krbyaP7i2Quw32uQWPED0aRDtTisPxIC0uQ+7Ya8VNEZd0d3ZYSy+HJsE107LS5vkhOLfSSNohuE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781290368; c=relaxed/simple; bh=aUVXlsLRYk2c5YKTVW9ufSvzSBvPS1Xp5yYzo2AQHYg=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=W5nmRhto/JxAZgCSJVlbJPUqG7cIQTwLSYEz9wqeJtQblEzq78+U+Uirh39Qu+SdgXD/zlDXh4ZnC3K8NKRj2E0LwHIDPr8hXX62i6/uqGVY17cbiak59JBSDAJ30Eeqryd/iUi2xLIJbk0P/6jknv1qSfusal5HokcX/ixq6jU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b=Ncxe/UNR; arc=none smtp.client-ip=209.85.222.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="Ncxe/UNR" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-9155183b42cso169159185a.0 for ; Fri, 12 Jun 2026 11:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1781290365; x=1781895165; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=RKXLliqgtTBxJekB7mbNKHKBQgFiZXP7WXvZpb1HUvg=; b=Ncxe/UNRh7FRFRQUrKWh3bS1uprnM7tXj6LT1Z+H70u5zpIioxJPGNOSZ4K5w+zm5j SUaoUS+9nftgaKjNEEYzPj+wT7SFV+u92/cEhQxV3qlSxEfC3mNNoqzeAiEOo4gY3hqe m7RMnIF5pYDe/fyqV5eG5CJT9itCd/uSI759u5y78BVedeujJdu18iRmEUx51Bvrv/Ww +cL4cOIDwdgwontys9ava4DRC0rpgRsTx1q1uTOUNxCILNUfZBA/oerSNNrI9sp79kyt 3uJ26px98+vY6iNx/qdbQVEhL2uvyIwTn4dQ1UaAQ9NstEGHX2pt2qmL+wYrxAZMVk3+ BC3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781290365; x=1781895165; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=RKXLliqgtTBxJekB7mbNKHKBQgFiZXP7WXvZpb1HUvg=; b=EYH0QWxsFcusvBvn/7FVctehphJNMywAb7l/zPdQrkI9CmJxI8Ug421mLO2qUdS++l FlD2o4S9d2OHc/9RT0s+A8LJrTWw2Y/Vsf/ayoVjkWG9WiM5gmRS0d8jclL66bnRk/3F 1EfTrJg0kiIBuaj/ATiNl0eX/+fSJRDG/7AGy7/GDxqeH5wVgHDcA7yPxAWn5RWeY4xV Gkx4Sj0lX5OWCr23R4NVgCnio1ycgxzCu5Cl85sCNbAc5BnDwxTfcbxCyXzedlDIOoBI d6x2aXZgeiezj+pQehRDIjtZDtDbJ+gtecaspvanLXlAawjmWcmnT4PLVXdWbYGE8HNO EUTQ== X-Forwarded-Encrypted: i=1; AFNElJ9tQt4SpPl/KNPd/0BDyu3c6DniGDkskIn+UxIG3C6GNfnyQdzukog7gJpxNXqz1rmLSZlYmmpPLacCtug=@vger.kernel.org X-Gm-Message-State: AOJu0YwRWUET+QLeF9bNmbv8QR/4re55hM11F7K3UGtpaKucJx3pFk9X TRr9FUGpJ+1M1ipWvMlgOf4orTL4FPlhhXK5MRF5t18PzgCKNVjhXeYl3w+FwPYvN40= X-Gm-Gg: Acq92OHikUmdabIV7etTKx0sTbVLifPzTEIGSFI4INccbouqo92LeoxFshnwy2lWNRz kNUuWymZ0s4FMlHlTD5duNsrSFJzLEjT9fQRhtyjERJUE/pwQMu+XcLjml8mGfS6Cf9+PCVYijh nDpBmJZCkKSEX7Os6+KY6ubFmcv455Ulu2esO6n7LAVleUv5drk33rAyWJ4cVpl43rIUEB65w5c yR/TK+HiFHYWoep/gVF18wETEtYg93YnVqNtpNXo3rlN7nFylhaaoTSiFdFJLkzfCLzeFoeo2bb ifBE4+cFc11TXjx4An2wmo43ZKLN1K+mfY5Hqu0enDG2AEyYCgdxAhUOQsBLWYZ34OrUniW7U1M BH6ipR82hnjWPLHfUJdY5YUcYCm05kjRnJYX8gxD1ZusAI3PigAn4RdCesjXaAO4K6uSAX1AotU 6D3KaKsef2Ir1zICWlA3Nx/3Jk6gaS+m6k44nOAWyAtjgTG4ZXWl8= X-Received: by 2002:a05:620a:4008:b0:915:8654:dca5 with SMTP id af79cd13be357-9161c03e612mr500988485a.17.1781290364762; Fri, 12 Jun 2026 11:52:44 -0700 (PDT) Received: from plex ([71.181.43.54]) by smtp.gmail.com with ESMTPSA id af79cd13be357-91619f210b7sm294426985a.18.2026.06.12.11.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2026 11:52:44 -0700 (PDT) Date: Fri, 12 Jun 2026 18:52:43 +0000 From: Pasha Tatashin To: kees@kernel.org, rppt@kernel.org, gpiccoli@igalia.com, tony.luck@intel.com, senozhatsky@chromium.org, linux-kernel@vger.kernel.org, pasha.tatashin@soleen.com, dmatlack@google.com, pratyush@kernel.org, mclapinski@google.com, john.ogness@linutronix.de, rostedt@goodmis.org, pmladek@suse.com, gregkh@linuxfoundation.org Subject: Re: [PATCH v1] printk: Add CON_NO_SUPPRESS console flag and use it for ramoops Message-ID: References: <20260612172623.1218280-1-pasha.tatashin@soleen.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260612172623.1218280-1-pasha.tatashin@soleen.com> On 06-12 17:26, Pasha Tatashin wrote: > The ramoops console is designed to capture and preserve logs across warm > reboots and liveupdates. It is registered during boot and captures logs > from that point forward. However, if a 'quiet' loglevel is specified on > the kernel command line, ramoops console logs (including important > shutdown/kexec handover logs) can be filtered out and suppressed by > printk. > > Specifying 'quiet' on the kernel command line is highly desirable to > avoid severe warm-reboot slowdowns, since physical serial consoles are > typically bottlenecked by slow baud rates. However, we still need to > fully capture all logs in memory via ramoops without suppression. > > Introduce a generic console flag CON_NO_SUPPRESS to allow specific > consoles (like the ramoops/pstore console) to opt-out of loglevel > suppression. Check this flag safely in console_emit_next_record() and > nbcon_emit_next_record(). Finally, set this flag on registration of the > pstore console in pstore_register_console(). > > Signed-off-by: Pasha Tatashin This patch is not needed base on the discussion in: https://lore.kernel.org/all/CAAi7L5fZTvhb5np=xGWnDEmr4bNXqoAcMhR_ePZ4Qga4E-KucQ@mail.gmail.com > --- > fs/pstore/platform.c | 2 +- > include/linux/console.h | 3 +++ > kernel/printk/nbcon.c | 5 ++++- > kernel/printk/printk.c | 4 +++- > 4 files changed, 11 insertions(+), 3 deletions(-) > > diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c > index 1d76c9d92056..9efbaa9895da 100644 > --- a/fs/pstore/platform.c > +++ b/fs/pstore/platform.c > @@ -420,7 +420,7 @@ static void pstore_register_console(void) > * Always initialize flags here since prior unregister_console() > * calls may have changed settings (specifically CON_ENABLED). > */ > - pstore_console.flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME; > + pstore_console.flags = CON_PRINTBUFFER | CON_ENABLED | CON_ANYTIME | CON_NO_SUPPRESS; > register_console(&pstore_console); > } > > diff --git a/include/linux/console.h b/include/linux/console.h > index 5520e4477ad7..9bd06d3fece3 100644 > --- a/include/linux/console.h > +++ b/include/linux/console.h > @@ -180,6 +180,8 @@ static inline void con_debug_leave(void) { } > * constraints. > * @CON_NBCON_ATOMIC_UNSAFE: The write_atomic() callback is not safe and is > * therefore only used by nbcon_atomic_flush_unsafe(). > + * @CON_NO_SUPPRESS: Indicates that the console is exempt from loglevel-based > + * message suppression (e.g. from the 'quiet' boot argument). > */ > enum cons_flags { > CON_PRINTBUFFER = BIT(0), > @@ -192,6 +194,7 @@ enum cons_flags { > CON_SUSPENDED = BIT(7), > CON_NBCON = BIT(8), > CON_NBCON_ATOMIC_UNSAFE = BIT(9), > + CON_NO_SUPPRESS = BIT(10), > }; > > /** > diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c > index d7044a7a214b..cd0fc5f42360 100644 > --- a/kernel/printk/nbcon.c > +++ b/kernel/printk/nbcon.c > @@ -989,6 +989,7 @@ static bool nbcon_emit_next_record(struct nbcon_write_context *wctxt, bool use_a > struct nbcon_state cur; > unsigned long dropped; > unsigned long ulseq; > + bool may_suppress; > > /* > * This function should never be called for consoles that have not > @@ -1014,7 +1015,9 @@ static bool nbcon_emit_next_record(struct nbcon_write_context *wctxt, bool use_a > if (!nbcon_context_enter_unsafe(ctxt)) > return false; > > - ctxt->backlog = printk_get_next_message(&pmsg, ctxt->seq, is_extended, true); > + may_suppress = !(console_srcu_read_flags(con) & CON_NO_SUPPRESS); > + ctxt->backlog = printk_get_next_message(&pmsg, ctxt->seq, is_extended, > + may_suppress); > if (!ctxt->backlog) > return nbcon_context_exit_unsafe(ctxt); > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index 0323149548f6..f6502cb84160 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -3131,10 +3131,12 @@ static bool console_emit_next_record(struct console *con, bool *handover, int co > .pbufs = &printk_shared_pbufs, > }; > unsigned long flags; > + bool may_suppress; > > *handover = false; > > - if (!printk_get_next_message(&pmsg, con->seq, is_extended, true)) > + may_suppress = !(console_srcu_read_flags(con) & CON_NO_SUPPRESS); > + if (!printk_get_next_message(&pmsg, con->seq, is_extended, may_suppress)) > return false; > > con->dropped += pmsg.dropped; > -- > 2.53.0 >