linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] printk: CONFIG_BASE_SMALL fix for LOG_CPU_MAX_BUF_SHIFT and removal of CONFIG_BASE_FULL
@ 2024-02-06  0:13 Yoann Congal
  2024-02-06  0:13 ` [PATCH v4 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Yoann Congal
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Yoann Congal @ 2024-02-06  0:13 UTC (permalink / raw)
  To: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86
  Cc: André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Masahiro Yamada, Matthew Wilcox, Peter Zijlstra,
	Petr Mladek, Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn, Yoann Congal

This series focuses on CONFIG_BASE_SMALL.
The first patch fixes LOG_CPU_MAX_BUF_SHIFT when CONFIG_BASE_SMALL is
used.
The second patch globally changes the type of CONFIG_BASE_SMALL and
adapts usages.
The third patch removes the now redundant BASE_FULL and puts BASE_SMALL
in its place in the config menus.

Thanks everyone for your reviews! :)

Patch history:
v3->v4: Applied Petr Mladek's suggestion (Thanks!):
* Keep BASE_SMALL instead of BASE_FULL
* A patch changing the type of BASE_SMALL was added.

v3 series was named "printk: CONFIG_BASE_SMALL fix for
LOG_CPU_MAX_BUF_SHIFT and removal"
https://lore.kernel.org/all/20240204232945.1576403-1-yoann.congal@smile.fr/
* Patch v3 1/2:
  * Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
  * Reviewed-by: John Ogness <john.ogness@linutronix.de>
  * Reviewed-by: Petr Mladek <pmladek@suse.com>
* Patch v3 2/2:
  * Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>

v2 -> v3: Applied Luis Chamberlain's comments (Thanks!):
* Split the single commit in two : one functional fix, one global
  removal.

v2 patch was named "printk: Remove redundant CONFIG_BASE_SMALL"
https://lore.kernel.org/all/20240127220026.1722399-1-yoann.congal@smile.fr/
* Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
* Reviewed-by: John Ogness <john.ogness@linutronix.de>

v1 -> v2: Applied Masahiro Yamada's comments (Thanks!):
* Changed from "Change CONFIG_BASE_SMALL to type bool" to
  "Remove it and switch usage to !CONFIG_BASE_FULL"
* Fixed "Fixes:" tag and reference to the mailing list thread.
* Added a note about CONFIG_LOG_CPU_MAX_BUF_SHIFT changing.

v1 patch was named "treewide: Change CONFIG_BASE_SMALL to bool type"
https://lore.kernel.org/all/20240126163032.1613731-1-yoann.congal@smile.fr/

Yoann Congal (3):
  printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled
  printk: Change type of CONFIG_BASE_SMALL to bool
  printk: Remove redundant CONFIG_BASE_FULL

 arch/x86/include/asm/mpspec.h |  6 +++---
 drivers/tty/vt/vc_screen.c    |  2 +-
 include/linux/threads.h       |  4 ++--
 include/linux/udp.h           |  2 +-
 include/linux/xarray.h        |  2 +-
 init/Kconfig                  | 15 +++++----------
 kernel/futex/core.c           |  2 +-
 kernel/user.c                 |  2 +-
 8 files changed, 15 insertions(+), 20 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v4 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled
  2024-02-06  0:13 [PATCH v4 0/3] printk: CONFIG_BASE_SMALL fix for LOG_CPU_MAX_BUF_SHIFT and removal of CONFIG_BASE_FULL Yoann Congal
@ 2024-02-06  0:13 ` Yoann Congal
  2024-02-06  9:00   ` Petr Mladek
  2024-02-06 23:03   ` Masahiro Yamada
  2024-02-06  0:13 ` [PATCH v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool Yoann Congal
  2024-02-06  0:13 ` [PATCH v4 3/3] printk: Remove redundant CONFIG_BASE_FULL Yoann Congal
  2 siblings, 2 replies; 12+ messages in thread
From: Yoann Congal @ 2024-02-06  0:13 UTC (permalink / raw)
  To: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86
  Cc: André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Masahiro Yamada, Matthew Wilcox, Peter Zijlstra,
	Petr Mladek, Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn, Yoann Congal, Vegard Nossum

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 the correct conditional operator for int
type : 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).

Petr Mladek <pmladek@suse.com> (printk maintainer) wrote:
> 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.

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")

---
v3->v4:
* Fix BASE_SMALL usage instead of switching to BASE_FULL because
  BASE_FULL will be removed in the next patches of this series.
---
 init/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init/Kconfig b/init/Kconfig
index deda3d14135bb..d50ebd2a2ce42 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -734,8 +734,8 @@ config LOG_CPU_MAX_BUF_SHIFT
 	int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)"
 	depends on SMP
 	range 0 21
-	default 12 if !BASE_SMALL
-	default 0 if BASE_SMALL
+	default 0 if BASE_SMALL != 0
+	default 12
 	depends on PRINTK
 	help
 	  This option allows to increase the default ring buffer size
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool
  2024-02-06  0:13 [PATCH v4 0/3] printk: CONFIG_BASE_SMALL fix for LOG_CPU_MAX_BUF_SHIFT and removal of CONFIG_BASE_FULL Yoann Congal
  2024-02-06  0:13 ` [PATCH v4 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Yoann Congal
@ 2024-02-06  0:13 ` Yoann Congal
  2024-02-06  9:01   ` Petr Mladek
                     ` (2 more replies)
  2024-02-06  0:13 ` [PATCH v4 3/3] printk: Remove redundant CONFIG_BASE_FULL Yoann Congal
  2 siblings, 3 replies; 12+ messages in thread
From: Yoann Congal @ 2024-02-06  0:13 UTC (permalink / raw)
  To: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86
  Cc: André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Masahiro Yamada, Matthew Wilcox, Peter Zijlstra,
	Petr Mladek, Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn, Yoann Congal

CONFIG_BASE_SMALL is currently a type int but is only used as a boolean.

So, change its type to bool and adapt all usages:
CONFIG_BASE_SMALL == 0 becomes !IS_ENABLED(CONFIG_BASE_SMALL) and
CONFIG_BASE_SMALL != 0 becomes  IS_ENABLED(CONFIG_BASE_SMALL).

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
NB: This is preliminary work for the following patch removing
CONFIG_BASE_FULL (now equivalent to !CONFIG_BASE_SMALL)

v3->v4:
* Split "switch CONFIG_BASE_SMALL to bool" (this patch) and "Remove the redundant
  config" into two patches
* keep CONFIG_BASE_SMALL instead of CONFIG_BASE_FULL
---
 arch/x86/include/asm/mpspec.h | 6 +++---
 drivers/tty/vt/vc_screen.c    | 2 +-
 include/linux/threads.h       | 4 ++--
 include/linux/udp.h           | 2 +-
 include/linux/xarray.h        | 2 +-
 init/Kconfig                  | 8 ++++----
 kernel/futex/core.c           | 2 +-
 kernel/user.c                 | 2 +-
 8 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index 4b0f98a8d338d..c01d3105840cf 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -15,10 +15,10 @@ extern int pic_mode;
  * Summit or generic (i.e. installer) kernels need lots of bus entries.
  * Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets.
  */
-#if CONFIG_BASE_SMALL == 0
-# define MAX_MP_BUSSES		260
-#else
+#ifdef CONFIG_BASE_SMALL
 # define MAX_MP_BUSSES		32
+#else
+# define MAX_MP_BUSSES		260
 #endif
 
 #define MAX_IRQ_SOURCES		256
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index 67e2cb7c96eec..da33c6c4691c0 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -51,7 +51,7 @@
 #include <asm/unaligned.h>
 
 #define HEADER_SIZE	4u
-#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE)
+#define CON_BUF_SIZE (IS_ENABLED(CONFIG_BASE_SMALL) ? 256 : PAGE_SIZE)
 
 /*
  * Our minor space:
diff --git a/include/linux/threads.h b/include/linux/threads.h
index c34173e6c5f18..1674a471b0b4c 100644
--- a/include/linux/threads.h
+++ b/include/linux/threads.h
@@ -25,13 +25,13 @@
 /*
  * This controls the default maximum pid allocated to a process
  */
-#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000)
+#define PID_MAX_DEFAULT (IS_ENABLED(CONFIG_BASE_SMALL) ? 0x1000 : 0x8000)
 
 /*
  * A maximum of 4 million PIDs should be enough for a while.
  * [NOTE: PID/TIDs are limited to 2^30 ~= 1 billion, see FUTEX_TID_MASK.]
  */
-#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
+#define PID_MAX_LIMIT (IS_ENABLED(CONFIG_BASE_SMALL) ? PAGE_SIZE * 8 : \
 	(sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
 
 /*
diff --git a/include/linux/udp.h b/include/linux/udp.h
index d04188714dca1..b456417fb4515 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -24,7 +24,7 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
 }
 
 #define UDP_HTABLE_SIZE_MIN_PERNET	128
-#define UDP_HTABLE_SIZE_MIN		(CONFIG_BASE_SMALL ? 128 : 256)
+#define UDP_HTABLE_SIZE_MIN		(IS_ENABLED(CONFIG_BASE_SMALL) ? 128 : 256)
 #define UDP_HTABLE_SIZE_MAX		65536
 
 static inline u32 udp_hashfn(const struct net *net, u32 num, u32 mask)
diff --git a/include/linux/xarray.h b/include/linux/xarray.h
index cb571dfcf4b16..3f81ee5f9fb9c 100644
--- a/include/linux/xarray.h
+++ b/include/linux/xarray.h
@@ -1141,7 +1141,7 @@ static inline void xa_release(struct xarray *xa, unsigned long index)
  * doubled the number of slots per node, we'd get only 3 nodes per 4kB page.
  */
 #ifndef XA_CHUNK_SHIFT
-#define XA_CHUNK_SHIFT		(CONFIG_BASE_SMALL ? 4 : 6)
+#define XA_CHUNK_SHIFT		(IS_ENABLED(CONFIG_BASE_SMALL) ? 4 : 6)
 #endif
 #define XA_CHUNK_SIZE		(1UL << XA_CHUNK_SHIFT)
 #define XA_CHUNK_MASK		(XA_CHUNK_SIZE - 1)
diff --git a/init/Kconfig b/init/Kconfig
index d50ebd2a2ce42..d4b16cad98502 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -734,7 +734,7 @@ config LOG_CPU_MAX_BUF_SHIFT
 	int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)"
 	depends on SMP
 	range 0 21
-	default 0 if BASE_SMALL != 0
+	default 0 if BASE_SMALL
 	default 12
 	depends on PRINTK
 	help
@@ -1941,9 +1941,9 @@ config RT_MUTEXES
 	default y if PREEMPT_RT
 
 config BASE_SMALL
-	int
-	default 0 if BASE_FULL
-	default 1 if !BASE_FULL
+	bool
+	default y if !BASE_FULL
+	default n
 
 config MODULE_SIG_FORMAT
 	def_bool n
diff --git a/kernel/futex/core.c b/kernel/futex/core.c
index 1e78ef24321e8..06a1f091be81d 100644
--- a/kernel/futex/core.c
+++ b/kernel/futex/core.c
@@ -1150,7 +1150,7 @@ static int __init futex_init(void)
 	unsigned int futex_shift;
 	unsigned long i;
 
-#if CONFIG_BASE_SMALL
+#ifdef CONFIG_BASE_SMALL
 	futex_hashsize = 16;
 #else
 	futex_hashsize = roundup_pow_of_two(256 * num_possible_cpus());
diff --git a/kernel/user.c b/kernel/user.c
index 03cedc366dc9e..aa1162deafe49 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -88,7 +88,7 @@ EXPORT_SYMBOL_GPL(init_user_ns);
  * when changing user ID's (ie setuid() and friends).
  */
 
-#define UIDHASH_BITS	(CONFIG_BASE_SMALL ? 3 : 7)
+#define UIDHASH_BITS	(IS_ENABLED(CONFIG_BASE_SMALL) ? 3 : 7)
 #define UIDHASH_SZ	(1 << UIDHASH_BITS)
 #define UIDHASH_MASK		(UIDHASH_SZ - 1)
 #define __uidhashfn(uid)	(((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK)
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v4 3/3] printk: Remove redundant CONFIG_BASE_FULL
  2024-02-06  0:13 [PATCH v4 0/3] printk: CONFIG_BASE_SMALL fix for LOG_CPU_MAX_BUF_SHIFT and removal of CONFIG_BASE_FULL Yoann Congal
  2024-02-06  0:13 ` [PATCH v4 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Yoann Congal
  2024-02-06  0:13 ` [PATCH v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool Yoann Congal
@ 2024-02-06  0:13 ` Yoann Congal
  2024-02-06  9:04   ` Petr Mladek
  2024-02-06 13:25   ` Masahiro Yamada
  2 siblings, 2 replies; 12+ messages in thread
From: Yoann Congal @ 2024-02-06  0:13 UTC (permalink / raw)
  To: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86
  Cc: André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Masahiro Yamada, Matthew Wilcox, Peter Zijlstra,
	Petr Mladek, Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn, Yoann Congal

CONFIG_BASE_FULL is equivalent to !CONFIG_BASE_SMALL and is enabled by
default: CONFIG_BASE_SMALL is the special case to take care of.
So, remove CONFIG_BASE_FULL and move the config choice to
CONFIG_BASE_SMALL (which defaults to 'n')

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
v3->v4:
* Split "switch CONFIG_BASE_SMALL to bool" and "Remove the redundant
  config" (this patch) into two patches
* keep CONFIG_BASE_SMALL instead of CONFIG_BASE_FULL
---
 init/Kconfig | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/init/Kconfig b/init/Kconfig
index d4b16cad98502..4ecf2572d00ee 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1581,11 +1581,11 @@ config PCSPKR_PLATFORM
 	  This option allows to disable the internal PC-Speaker
 	  support, saving some memory.
 
-config BASE_FULL
-	default y
-	bool "Enable full-sized data structures for core" if EXPERT
+config BASE_SMALL
+	default n
+	bool "Enable smaller-sized data structures for core" if EXPERT
 	help
-	  Disabling this option reduces the size of miscellaneous core
+	  Enabling this option reduces the size of miscellaneous core
 	  kernel data structures. This saves memory on small machines,
 	  but may reduce performance.
 
@@ -1940,11 +1940,6 @@ config RT_MUTEXES
 	bool
 	default y if PREEMPT_RT
 
-config BASE_SMALL
-	bool
-	default y if !BASE_FULL
-	default n
-
 config MODULE_SIG_FORMAT
 	def_bool n
 	select SYSTEM_DATA_VERIFICATION
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled
  2024-02-06  0:13 ` [PATCH v4 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Yoann Congal
@ 2024-02-06  9:00   ` Petr Mladek
  2024-02-06 23:03   ` Masahiro Yamada
  1 sibling, 0 replies; 12+ messages in thread
From: Petr Mladek @ 2024-02-06  9:00 UTC (permalink / raw)
  To: Yoann Congal
  Cc: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86,
	André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Masahiro Yamada, Matthew Wilcox, Peter Zijlstra,
	Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn, Vegard Nossum

On Tue 2024-02-06 01:13:31, 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 the correct conditional operator for int
> type : 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).
> 
> Petr Mladek <pmladek@suse.com> (printk maintainer) wrote:
> > 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.
> 
> 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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool
  2024-02-06  0:13 ` [PATCH v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool Yoann Congal
@ 2024-02-06  9:01   ` Petr Mladek
  2024-02-06 14:24   ` Greg Kroah-Hartman
  2024-02-06 23:05   ` Masahiro Yamada
  2 siblings, 0 replies; 12+ messages in thread
From: Petr Mladek @ 2024-02-06  9:01 UTC (permalink / raw)
  To: Yoann Congal
  Cc: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86,
	André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Masahiro Yamada, Matthew Wilcox, Peter Zijlstra,
	Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn

On Tue 2024-02-06 01:13:32, Yoann Congal wrote:
> CONFIG_BASE_SMALL is currently a type int but is only used as a boolean.
> 
> So, change its type to bool and adapt all usages:
> CONFIG_BASE_SMALL == 0 becomes !IS_ENABLED(CONFIG_BASE_SMALL) and
> CONFIG_BASE_SMALL != 0 becomes  IS_ENABLED(CONFIG_BASE_SMALL).
> 
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 3/3] printk: Remove redundant CONFIG_BASE_FULL
  2024-02-06  0:13 ` [PATCH v4 3/3] printk: Remove redundant CONFIG_BASE_FULL Yoann Congal
@ 2024-02-06  9:04   ` Petr Mladek
  2024-02-06  9:08     ` Petr Mladek
  2024-02-06 13:25   ` Masahiro Yamada
  1 sibling, 1 reply; 12+ messages in thread
From: Petr Mladek @ 2024-02-06  9:04 UTC (permalink / raw)
  To: Yoann Congal
  Cc: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86,
	André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Masahiro Yamada, Matthew Wilcox, Peter Zijlstra,
	Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn

On Tue 2024-02-06 01:13:33, Yoann Congal wrote:
> CONFIG_BASE_FULL is equivalent to !CONFIG_BASE_SMALL and is enabled by
> default: CONFIG_BASE_SMALL is the special case to take care of.
> So, remove CONFIG_BASE_FULL and move the config choice to
> CONFIG_BASE_SMALL (which defaults to 'n')
> 
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>

This might also require updatating the default config files which
unset CONFIG_BASE_FULL. I mean:

$> git grep BASE_FULL arch/
arch/arm/configs/collie_defconfig:# CONFIG_BASE_FULL is not set
arch/arm/configs/keystone_defconfig:# CONFIG_BASE_FULL is not set
arch/arm/configs/lpc18xx_defconfig:# CONFIG_BASE_FULL is not set
arch/arm/configs/moxart_defconfig:# CONFIG_BASE_FULL is not set
arch/arm/configs/mps2_defconfig:# CONFIG_BASE_FULL is not set
arch/arm/configs/omap1_defconfig:# CONFIG_BASE_FULL is not set
arch/arm/configs/stm32_defconfig:# CONFIG_BASE_FULL is not set
arch/microblaze/configs/mmu_defconfig:# CONFIG_BASE_FULL is not set
arch/mips/configs/rs90_defconfig:# CONFIG_BASE_FULL is not set
arch/powerpc/configs/adder875_defconfig:# CONFIG_BASE_FULL is not set
arch/powerpc/configs/ep88xc_defconfig:# CONFIG_BASE_FULL is not set
arch/powerpc/configs/mpc866_ads_defconfig:# CONFIG_BASE_FULL is not set
arch/powerpc/configs/mpc885_ads_defconfig:# CONFIG_BASE_FULL is not set
arch/powerpc/configs/tqm8xx_defconfig:# CONFIG_BASE_FULL is not set
arch/riscv/configs/nommu_k210_defconfig:# CONFIG_BASE_FULL is not set
arch/riscv/configs/nommu_k210_sdcard_defconfig:# CONFIG_BASE_FULL is not set
arch/riscv/configs/nommu_virt_defconfig:# CONFIG_BASE_FULL is not set
arch/sh/configs/edosk7705_defconfig:# CONFIG_BASE_FULL is not set
arch/sh/configs/se7619_defconfig:# CONFIG_BASE_FULL is not set
arch/sh/configs/se7712_defconfig:# CONFIG_BASE_FULL is not set
arch/sh/configs/se7721_defconfig:# CONFIG_BASE_FULL is not set
arch/sh/configs/shmin_defconfig:# CONFIG_BASE_FULL is not set

Best Regards,
Petr

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 3/3] printk: Remove redundant CONFIG_BASE_FULL
  2024-02-06  9:04   ` Petr Mladek
@ 2024-02-06  9:08     ` Petr Mladek
  0 siblings, 0 replies; 12+ messages in thread
From: Petr Mladek @ 2024-02-06  9:08 UTC (permalink / raw)
  To: Yoann Congal
  Cc: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86,
	André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Masahiro Yamada, Matthew Wilcox, Peter Zijlstra,
	Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn

On Tue 2024-02-06 10:04:20, Petr Mladek wrote:
> On Tue 2024-02-06 01:13:33, Yoann Congal wrote:
> > CONFIG_BASE_FULL is equivalent to !CONFIG_BASE_SMALL and is enabled by
> > default: CONFIG_BASE_SMALL is the special case to take care of.
> > So, remove CONFIG_BASE_FULL and move the config choice to
> > CONFIG_BASE_SMALL (which defaults to 'n')
> > 
> > Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> 
> This might also require updatating the default config files which
> unset CONFIG_BASE_FULL. I mean:
> 
> $> git grep BASE_FULL arch/
> arch/arm/configs/collie_defconfig:# CONFIG_BASE_FULL is not set
> arch/arm/configs/keystone_defconfig:# CONFIG_BASE_FULL is not set
> arch/arm/configs/lpc18xx_defconfig:# CONFIG_BASE_FULL is not set
> arch/arm/configs/moxart_defconfig:# CONFIG_BASE_FULL is not set
> arch/arm/configs/mps2_defconfig:# CONFIG_BASE_FULL is not set
> arch/arm/configs/omap1_defconfig:# CONFIG_BASE_FULL is not set
> arch/arm/configs/stm32_defconfig:# CONFIG_BASE_FULL is not set
> arch/microblaze/configs/mmu_defconfig:# CONFIG_BASE_FULL is not set
> arch/mips/configs/rs90_defconfig:# CONFIG_BASE_FULL is not set
> arch/powerpc/configs/adder875_defconfig:# CONFIG_BASE_FULL is not set
> arch/powerpc/configs/ep88xc_defconfig:# CONFIG_BASE_FULL is not set
> arch/powerpc/configs/mpc866_ads_defconfig:# CONFIG_BASE_FULL is not set
> arch/powerpc/configs/mpc885_ads_defconfig:# CONFIG_BASE_FULL is not set
> arch/powerpc/configs/tqm8xx_defconfig:# CONFIG_BASE_FULL is not set
> arch/riscv/configs/nommu_k210_defconfig:# CONFIG_BASE_FULL is not set
> arch/riscv/configs/nommu_k210_sdcard_defconfig:# CONFIG_BASE_FULL is not set
> arch/riscv/configs/nommu_virt_defconfig:# CONFIG_BASE_FULL is not set
> arch/sh/configs/edosk7705_defconfig:# CONFIG_BASE_FULL is not set
> arch/sh/configs/se7619_defconfig:# CONFIG_BASE_FULL is not set
> arch/sh/configs/se7712_defconfig:# CONFIG_BASE_FULL is not set
> arch/sh/configs/se7721_defconfig:# CONFIG_BASE_FULL is not set
> arch/sh/configs/shmin_defconfig:# CONFIG_BASE_FULL is not set

Ah, also we should drop:

tools/testing/selftests/wireguard/qemu/kernel.config:CONFIG_BASE_FULL=y

Best Regards,
Petr

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 3/3] printk: Remove redundant CONFIG_BASE_FULL
  2024-02-06  0:13 ` [PATCH v4 3/3] printk: Remove redundant CONFIG_BASE_FULL Yoann Congal
  2024-02-06  9:04   ` Petr Mladek
@ 2024-02-06 13:25   ` Masahiro Yamada
  1 sibling, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2024-02-06 13:25 UTC (permalink / raw)
  To: Yoann Congal
  Cc: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86,
	André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Matthew Wilcox, Peter Zijlstra, Petr Mladek,
	Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn

On Tue, Feb 6, 2024 at 9:13 AM Yoann Congal <yoann.congal@smile.fr> wrote:
>
> CONFIG_BASE_FULL is equivalent to !CONFIG_BASE_SMALL and is enabled by
> default: CONFIG_BASE_SMALL is the special case to take care of.
> So, remove CONFIG_BASE_FULL and move the config choice to
> CONFIG_BASE_SMALL (which defaults to 'n')
>
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> ---
> v3->v4:
> * Split "switch CONFIG_BASE_SMALL to bool" and "Remove the redundant
>   config" (this patch) into two patches
> * keep CONFIG_BASE_SMALL instead of CONFIG_BASE_FULL
> ---
>  init/Kconfig | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/init/Kconfig b/init/Kconfig
> index d4b16cad98502..4ecf2572d00ee 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1581,11 +1581,11 @@ config PCSPKR_PLATFORM
>           This option allows to disable the internal PC-Speaker
>           support, saving some memory.
>
> -config BASE_FULL
> -       default y
> -       bool "Enable full-sized data structures for core" if EXPERT
> +config BASE_SMALL
> +       default n



A nit.

Please drop the redundant 'default n' next time
(as it seems you will have a change to send v5)







> +       bool "Enable smaller-sized data structures for core" if EXPERT
>         help
> -         Disabling this option reduces the size of miscellaneous core
> +         Enabling this option reduces the size of miscellaneous core
>           kernel data structures. This saves memory on small machines,
>           but may reduce performance.
>
> @@ -1940,11 +1940,6 @@ config RT_MUTEXES
>         bool
>         default y if PREEMPT_RT
>
> -config BASE_SMALL
> -       bool
> -       default y if !BASE_FULL
> -       default n
> -
>  config MODULE_SIG_FORMAT
>         def_bool n
>         select SYSTEM_DATA_VERIFICATION
> --
> 2.39.2
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool
  2024-02-06  0:13 ` [PATCH v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool Yoann Congal
  2024-02-06  9:01   ` Petr Mladek
@ 2024-02-06 14:24   ` Greg Kroah-Hartman
  2024-02-06 23:05   ` Masahiro Yamada
  2 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-06 14:24 UTC (permalink / raw)
  To: Yoann Congal
  Cc: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86,
	André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, H . Peter Anvin,
	Ingo Molnar, Jiri Slaby, John Ogness, Josh Triplett,
	Masahiro Yamada, Matthew Wilcox, Peter Zijlstra, Petr Mladek,
	Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn

On Tue, Feb 06, 2024 at 01:13:32AM +0100, Yoann Congal wrote:
> CONFIG_BASE_SMALL is currently a type int but is only used as a boolean.
> 
> So, change its type to bool and adapt all usages:
> CONFIG_BASE_SMALL == 0 becomes !IS_ENABLED(CONFIG_BASE_SMALL) and
> CONFIG_BASE_SMALL != 0 becomes  IS_ENABLED(CONFIG_BASE_SMALL).
> 
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> ---
> NB: This is preliminary work for the following patch removing
> CONFIG_BASE_FULL (now equivalent to !CONFIG_BASE_SMALL)

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled
  2024-02-06  0:13 ` [PATCH v4 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Yoann Congal
  2024-02-06  9:00   ` Petr Mladek
@ 2024-02-06 23:03   ` Masahiro Yamada
  1 sibling, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2024-02-06 23:03 UTC (permalink / raw)
  To: Yoann Congal
  Cc: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86,
	André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Matthew Wilcox, Peter Zijlstra, Petr Mladek,
	Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn, Vegard Nossum

On Tue, Feb 6, 2024 at 9:13 AM Yoann Congal <yoann.congal@smile.fr> 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 the correct conditional operator for int
> type : 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).
>
> Petr Mladek <pmladek@suse.com> (printk maintainer) wrote:
> > 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.
>
> 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: Masahiro Yamada <masahiroy@kernel.org>





-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool
  2024-02-06  0:13 ` [PATCH v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool Yoann Congal
  2024-02-06  9:01   ` Petr Mladek
  2024-02-06 14:24   ` Greg Kroah-Hartman
@ 2024-02-06 23:05   ` Masahiro Yamada
  2 siblings, 0 replies; 12+ messages in thread
From: Masahiro Yamada @ 2024-02-06 23:05 UTC (permalink / raw)
  To: Yoann Congal
  Cc: linux-fsdevel, linux-kbuild, linux-kernel, linux-serial, x86,
	André Almeida, Borislav Petkov, Darren Hart, Dave Hansen,
	Davidlohr Bueso, Geert Uytterhoeven, Greg Kroah-Hartman,
	H . Peter Anvin, Ingo Molnar, Jiri Slaby, John Ogness,
	Josh Triplett, Matthew Wilcox, Peter Zijlstra, Petr Mladek,
	Sergey Senozhatsky, Steven Rostedt, Thomas Gleixner,
	Willem de Bruijn

On Tue, Feb 6, 2024 at 9:13 AM Yoann Congal <yoann.congal@smile.fr> wrote:
>
> CONFIG_BASE_SMALL is currently a type int but is only used as a boolean.
>
> So, change its type to bool and adapt all usages:
> CONFIG_BASE_SMALL == 0 becomes !IS_ENABLED(CONFIG_BASE_SMALL) and
> CONFIG_BASE_SMALL != 0 becomes  IS_ENABLED(CONFIG_BASE_SMALL).
>
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> ---
> NB: This is preliminary work for the following patch removing
> CONFIG_BASE_FULL (now equivalent to !CONFIG_BASE_SMALL)
>
> v3->v4:
> * Split "switch CONFIG_BASE_SMALL to bool" (this patch) and "Remove the redundant
>   config" into two patches
> * keep CONFIG_BASE_SMALL instead of CONFIG_BASE_FULL
> ---
>  arch/x86/include/asm/mpspec.h | 6 +++---
>  drivers/tty/vt/vc_screen.c    | 2 +-
>  include/linux/threads.h       | 4 ++--
>  include/linux/udp.h           | 2 +-
>  include/linux/xarray.h        | 2 +-
>  init/Kconfig                  | 8 ++++----
>  kernel/futex/core.c           | 2 +-
>  kernel/user.c                 | 2 +-
>  8 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
> index 4b0f98a8d338d..c01d3105840cf 100644
> --- a/arch/x86/include/asm/mpspec.h
> +++ b/arch/x86/include/asm/mpspec.h
> @@ -15,10 +15,10 @@ extern int pic_mode;
>   * Summit or generic (i.e. installer) kernels need lots of bus entries.
>   * Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets.
>   */
> -#if CONFIG_BASE_SMALL == 0
> -# define MAX_MP_BUSSES         260
> -#else
> +#ifdef CONFIG_BASE_SMALL
>  # define MAX_MP_BUSSES         32
> +#else
> +# define MAX_MP_BUSSES         260
>  #endif
>
>  #define MAX_IRQ_SOURCES                256
> diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
> index 67e2cb7c96eec..da33c6c4691c0 100644
> --- a/drivers/tty/vt/vc_screen.c
> +++ b/drivers/tty/vt/vc_screen.c
> @@ -51,7 +51,7 @@
>  #include <asm/unaligned.h>
>
>  #define HEADER_SIZE    4u
> -#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE)
> +#define CON_BUF_SIZE (IS_ENABLED(CONFIG_BASE_SMALL) ? 256 : PAGE_SIZE)
>
>  /*
>   * Our minor space:
> diff --git a/include/linux/threads.h b/include/linux/threads.h
> index c34173e6c5f18..1674a471b0b4c 100644
> --- a/include/linux/threads.h
> +++ b/include/linux/threads.h
> @@ -25,13 +25,13 @@
>  /*
>   * This controls the default maximum pid allocated to a process
>   */
> -#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000)
> +#define PID_MAX_DEFAULT (IS_ENABLED(CONFIG_BASE_SMALL) ? 0x1000 : 0x8000)
>
>  /*
>   * A maximum of 4 million PIDs should be enough for a while.
>   * [NOTE: PID/TIDs are limited to 2^30 ~= 1 billion, see FUTEX_TID_MASK.]
>   */
> -#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
> +#define PID_MAX_LIMIT (IS_ENABLED(CONFIG_BASE_SMALL) ? PAGE_SIZE * 8 : \
>         (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
>
>  /*
> diff --git a/include/linux/udp.h b/include/linux/udp.h
> index d04188714dca1..b456417fb4515 100644
> --- a/include/linux/udp.h
> +++ b/include/linux/udp.h
> @@ -24,7 +24,7 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
>  }
>
>  #define UDP_HTABLE_SIZE_MIN_PERNET     128
> -#define UDP_HTABLE_SIZE_MIN            (CONFIG_BASE_SMALL ? 128 : 256)
> +#define UDP_HTABLE_SIZE_MIN            (IS_ENABLED(CONFIG_BASE_SMALL) ? 128 : 256)
>  #define UDP_HTABLE_SIZE_MAX            65536
>
>  static inline u32 udp_hashfn(const struct net *net, u32 num, u32 mask)
> diff --git a/include/linux/xarray.h b/include/linux/xarray.h
> index cb571dfcf4b16..3f81ee5f9fb9c 100644
> --- a/include/linux/xarray.h
> +++ b/include/linux/xarray.h
> @@ -1141,7 +1141,7 @@ static inline void xa_release(struct xarray *xa, unsigned long index)
>   * doubled the number of slots per node, we'd get only 3 nodes per 4kB page.
>   */
>  #ifndef XA_CHUNK_SHIFT
> -#define XA_CHUNK_SHIFT         (CONFIG_BASE_SMALL ? 4 : 6)
> +#define XA_CHUNK_SHIFT         (IS_ENABLED(CONFIG_BASE_SMALL) ? 4 : 6)
>  #endif
>  #define XA_CHUNK_SIZE          (1UL << XA_CHUNK_SHIFT)
>  #define XA_CHUNK_MASK          (XA_CHUNK_SIZE - 1)
> diff --git a/init/Kconfig b/init/Kconfig
> index d50ebd2a2ce42..d4b16cad98502 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -734,7 +734,7 @@ config LOG_CPU_MAX_BUF_SHIFT
>         int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)"
>         depends on SMP
>         range 0 21
> -       default 0 if BASE_SMALL != 0
> +       default 0 if BASE_SMALL
>         default 12
>         depends on PRINTK
>         help
> @@ -1941,9 +1941,9 @@ config RT_MUTEXES
>         default y if PREEMPT_RT
>
>  config BASE_SMALL
> -       int
> -       default 0 if BASE_FULL
> -       default 1 if !BASE_FULL
> +       bool
> +       default y if !BASE_FULL
> +       default n



The shortest form would be:


config BASE_SMALL
        def_bool !BASE_FULL



But, that is not a big deal, as this hunk will
be removed by 3/3.




Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>








-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-02-06 23:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06  0:13 [PATCH v4 0/3] printk: CONFIG_BASE_SMALL fix for LOG_CPU_MAX_BUF_SHIFT and removal of CONFIG_BASE_FULL Yoann Congal
2024-02-06  0:13 ` [PATCH v4 1/3] printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled Yoann Congal
2024-02-06  9:00   ` Petr Mladek
2024-02-06 23:03   ` Masahiro Yamada
2024-02-06  0:13 ` [PATCH v4 2/3] printk: Change type of CONFIG_BASE_SMALL to bool Yoann Congal
2024-02-06  9:01   ` Petr Mladek
2024-02-06 14:24   ` Greg Kroah-Hartman
2024-02-06 23:05   ` Masahiro Yamada
2024-02-06  0:13 ` [PATCH v4 3/3] printk: Remove redundant CONFIG_BASE_FULL Yoann Congal
2024-02-06  9:04   ` Petr Mladek
2024-02-06  9:08     ` Petr Mladek
2024-02-06 13:25   ` Masahiro Yamada

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).