Skip to contentSkip to conversation

init/Kconfig: Fix CPU number in LOG_CPU_MAX_BUF_SHIFT description

PATCH Superseded Paul Menzel 2 participants 2 messages Aug 11, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 init/Kconfig: Fix CPU number in LOG_CPU_MAX_BUF_SHIFT description

Currently, LOG_BUF_SHIFT defaults to 17, which is 2 ^ 17 bytes = 128 KB, and LOG_CPU_MAX_BUF_SHIFT defaults to 12, which is 2 ^ 12 bytes = 4 KB.

Half of 128 KB is 64 KB, so more than 16 CPUs are required for the value to be used, as then the sum of contributions is greater than 64 KB for the first time. My guess is, that the description was written with the configuration values used in the SUSE in mind.

Cc Luis R. Rodriguez <[email protected]>
Fixes 23b2899f7f ("printk: allow increasing the ring buffer depending on the number of CPUs")
---
 init/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
init/Kconfig +1 -1
index d6a0b31b13dc..9dc607e3806f 100644
@@ -718,7 +718,7 @@ config LOG_CPU_MAX_BUF_SHIFT
 	  with more CPUs. Therefore this value is used only when the sum of
 	  contributions is greater than the half of the default kernel ring
 	  buffer as defined by LOG_BUF_SHIFT. The default values are set
-	  so that more than 64 CPUs are needed to trigger the allocation.
+	  so that more than 16 CPUs are needed to trigger the allocation.
 
 	  Also this option is ignored when "log_buf_len" kernel parameter is
 	  used as it forces an exact (power of two) size of the ring buffer.
Signature · 1 line
2.28.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Paul Menzel

Currently, LOG_BUF_SHIFT defaults to 17, which is 2 ^ 17 bytes = 128 KB, and LOG_CPU_MAX_BUF_SHIFT defaults to 12, which is 2 ^ 12 bytes = 4 KB.

Half of 128 KB is 64 KB, so more than 16 CPUs are required for the value to be used, as then the sum of contributions is greater than 64 KB for the first time. My guess is, that the description was written with the configuration values used in the SUSE in mind.

Quoted 4 lines
Cc Luis R. Rodriguez <[email protected]>
Fixes 23b2899f7f ("printk: allow increasing the ring buffer depending on the number of CPUs")

Great catch.

Best Regards,
Petr