LINUX.ORG.RU

Смысл CONFIG_LOG_CPU_MAX_BUF_SHIFT

 ,


0

0

Читаю описание этой опции в 3.17 и ничего не понимаю. Кто в курсе разработки ядра? Можете пояснить?

This option allows to increase the default ring buffer size
according to the number of CPUs. The value defines the contribution
of each CPU as a power of 2. The used space is typically only few
lines however it might be much more when problems are reported,
e.g. backtraces.

The increased size means that a new buffer has to be allocated and
the original static one is unused. It makes sense only on systems
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.

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.

The number of possible CPUs is used for this computation ignoring
hotplugging making the compuation optimal for the the worst case
scenerio while allowing a simple algorithm to be used from bootup.

Examples shift values and their meaning:
           17 => 128 KB for each CPU
           16 =>  64 KB for each CPU
           15 =>  32 KB for each CPU
           14 =>  16 KB for each CPU
           13 =>   8 KB for each CPU
           12 =>   4 KB for each CPU

Ответ на: комментарий от anonymous

Что такое «ring buffer» в контексте CONFIG_LOG_CPU_MAX_BUF_SHIFT? Это связано с логгированием? Чего? Куда? Зачем?

Смысл

The increased size means that a new buffer has to be allocated and
the original static one is unused. It makes sense only on systems
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.

Вообще не понимаю.

Не стройте из себя умного, короче. Если всё так ясно - объясните на пальцах.

thespiritofbirdie
() автор топика
Ответ на: комментарий от anonymous

каждое ядро процессора может генерировать свои сообщения, потому размер буфера должен быть пропорционален количеству ядер

anonymous
()
Ответ на: комментарий от anonymous

printk - теперь ясно, хотя в описании ни слова.

Не ясно зачем нужно менять размер этого буфера. Чтобы данные printk не терялись, если userspace не успевает их дампать на диск?

Почему буфер на каждый процессор, а не один на все?

thespiritofbirdie
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.