On Mon 2020-07-27 14:00:00, John Ogness wrote:
On 2020-07-22, kernel test robot <lkp(a)intel.com> wrote:
> tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: de2e69cfe54a8f2ed4b75f09d3110c514f45d38e
> commit: 896fbe20b4e2333fb55cc9b9b783ebcc49eee7c7 [6188/10009] printk: use the
lockless ringbuffer
> config: h8300-randconfig-c022-20200720 (attached as .config)
> compiler: h8300-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
> wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout 896fbe20b4e2333fb55cc9b9b783ebcc49eee7c7
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp(a)intel.com>
>
> All errors (new ones prefixed by >>):
>
> h8300-linux-ld: section .init.text LMA [00000000005eaf40,000000000062100b]
overlaps section .text LMA [000000000000025c,00000000007942cf]
> h8300-linux-ld: section .data VMA [0000000000400000,00000000005eaf3f] overlaps
section .text VMA [000000000000025c,00000000007942cf]
>>> h8300-linux-ld: section .softirqentry.text VMA
[00000000007942d0,0000000000794597] overlaps section .bss VMA
[000000000062c340,0000000000847b4f]
The .bss section for the h8300 is relatively small. A default
CONFIG_LOG_BUF_SHIFT value of 20 will create a static printk ringbuffer
that is too large. This is a problem with the new printk ringbuffer
because it now occupies double the .bss space.
Is it enough to ignore this problem and require h8300 users to use a
smaller CONFIG_LOG_BUF_SHIFT value (which they probably are anyway)? Or
should we change the default for CONFIG_H8300? I am open for ideas.
In theory, it should be safe to lower the default value by one on all
architectures. The dictionary and metadata are stored separately
so more messages can be stored into the data ring.
Let's look at my test system using the original log buffer[*]:
text: 30 kB
metadata: 14 kB
dict: 9 kB
The text takes more than half of the space. But the difference is not
too huge. So decreasing CONFIG_LOG_BUF_SHIFT by one might be acceptable.
Also it might make sense to decrease the size of the dict ring by
two. I mean to have size of text:dict rings as 2:1.
Well, it would be nice to check the statistic on more systems.
That said, I am fine also with reducing the default only on h8300.
It should be enough to define it in in arch/h8300/Kconfig. I see
that, for example, PGTABLE_LEVELS variable is redefined on some
architectures.
=====================
[*] Below is how I got the above numbers:
$> pahole -y printk_log kernel/printk/printk.o
struct printk_log {
u64 ts_nsec; /* 0 8 */
u16 len; /* 8 2 */
u16 text_len; /* 10 2 */
u16 dict_len; /* 12 2 */
u8 facility; /* 14 1 */
u8 flags:5; /* 15: 3 1 */
u8 level:3; /* 15: 0 1 */
u32 caller_id; /* 16 4 */
/* size: 20, cachelines: 1, members: 8 */
/* last cacheline: 20 bytes */
};
$> dmesg | wc -l
701
$> echo $((701 * 20))
14020
# => metadata: 14 kB
$> cat /dev/kmsg >/tmp/dev_kmsg
$> cat /tmp/dev_kmsg | grep caller= | cut -d: -f2- | sed -e
"s/^.*caller=T1;//" | wc -c
30997
# => text: 30 kB
$> cat /tmp/dev_kmsg | grep -v caller= | wc -c
9293
# => dict: 9 kB
Best Regards,
Petr