From: Petr Mladek <pmladek@suse.com>
To: Yoann Congal <yoann.congal@smile.fr>
Cc: linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
x86@kernel.org, "André Almeida" <andrealmeid@igalia.com>,
"Borislav Petkov" <bp@alien8.de>,
"Darren Hart" <dvhart@infradead.org>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
"Davidlohr Bueso" <dave@stgolabs.net>,
"Geert Uytterhoeven" <geert@linux-m68k.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"H . Peter Anvin" <hpa@zytor.com>,
"Ingo Molnar" <mingo@redhat.com>,
"Jiri Slaby" <jirislaby@kernel.org>,
"John Ogness" <john.ogness@linutronix.de>,
"Josh Triplett" <josh@joshtriplett.org>,
"Masahiro Yamada" <masahiroy@kernel.org>,
"Matthew Wilcox" <willy@infradead.org>,
"Peter Zijlstra" <peterz@infradead.org>,
"Sergey Senozhatsky" <senozhatsky@chromium.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>,
"Vegard Nossum" <vegard.nossum@oracle.com>
Subject: Re: [PATCH v3 1/2] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled
Date: Mon, 5 Feb 2024 14:34:30 +0100 [thread overview]
Message-ID: <ZcDj5hZeu_LqEsuH@alley> (raw)
In-Reply-To: <20240204232945.1576403-2-yoann.congal@smile.fr>
On Mon 2024-02-05 00:29:44, Yoann Congal wrote:
> LOG_CPU_MAX_BUF_SHIFT default value depends on BASE_SMALL:
> config LOG_CPU_MAX_BUF_SHIFT
> default 12 if !BASE_SMALL
> default 0 if BASE_SMALL
> But, BASE_SMALL is a config of type int and "!BASE_SMALL" is always
> evaluated to true whatever is the value of BASE_SMALL.
>
> This patch fixes this by using BASE_FULL (type bool) which is equivalent
> to BASE_SMALL==0.
>
> Note: This changes CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 to
> CONFIG_LOG_CPU_MAX_BUF_SHIFT=0 for BASE_SMALL defconfigs, but that will
> not be a big impact due to this code in kernel/printk/printk.c:
> /* by default this will only continue through for large > 64 CPUs */
> if (cpu_extra <= __LOG_BUF_LEN / 2)
> return;
> Systems using CONFIG_BASE_SMALL and having 64+ CPUs should be quite
> rare.
>
> John Ogness <john.ogness@linutronix.de> (printk reviewer) wrote:
> > For printk this will mean that BASE_SMALL systems were probably
> > previously allocating/using the dynamic ringbuffer and now they will
> > just continue to use the static ringbuffer. Which is fine and saves
> > memory (as it should).
More precisely, it allocated the buffer dynamically when the sum
of per-CPU-extra space exceeded half of the default static ring
buffer. This happened for systems with more than 64 CPUs with
the default config values.
I believe that this patch won't have any effect in practice.
It is hard to imagine a system with >64 CPUs which would require
BASE_SMALL kernel. Well, never say never ;-)
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Closes: https://lore.kernel.org/all/CAMuHMdWm6u1wX7efZQf=2XUAHascps76YQac6rdnQGhc8nop_Q@mail.gmail.com/
> Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
> Closes: https://lore.kernel.org/all/f6856be8-54b7-0fa0-1d17-39632bf29ada@oracle.com/
> Fixes: 4e244c10eab3 ("kconfig: remove unneeded symbol_empty variable")
Reviewed-by: Petr Mladek <pmladek@suse.com>
Best Regards,
Petr
next prev parent reply other threads:[~2024-02-05 13:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-04 23:29 [PATCH v3 0/2] printk: CONFIG_BASE_SMALL fix for LOG_CPU_MAX_BUF_SHIFT and removal Yoann Congal
2024-02-04 23:29 ` [PATCH v3 1/2] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Yoann Congal
2024-02-05 3:02 ` Masahiro Yamada
2024-02-05 8:39 ` John Ogness
2024-02-05 13:34 ` Petr Mladek [this message]
2024-02-04 23:29 ` [PATCH v3 2/2] printk: Remove redundant CONFIG_BASE_SMALL Yoann Congal
2024-02-05 3:01 ` Masahiro Yamada
2024-02-05 13:37 ` Petr Mladek
2024-02-05 13:48 ` [PATCH v3 0/2] printk: CONFIG_BASE_SMALL fix for LOG_CPU_MAX_BUF_SHIFT and removal Petr Mladek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZcDj5hZeu_LqEsuH@alley \
--to=pmladek@suse.com \
--cc=andrealmeid@igalia.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=jirislaby@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=josh@joshtriplett.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=tglx@linutronix.de \
--cc=vegard.nossum@oracle.com \
--cc=willemdebruijn.kernel@gmail.com \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
--cc=yoann.congal@smile.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).