From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3109667512559240669==" MIME-Version: 1.0 From: Petr Mladek To: kbuild-all@lists.01.org Subject: Re: [linux-next:master 6188/10009] h8300-linux-ld: section .softirqentry.text VMA overlaps section .bss VMA Date: Wed, 05 Aug 2020 17:35:16 +0200 Message-ID: <20200805153515.GJ24529@alley> In-Reply-To: <87365d5g2v.fsf@jogness.linutronix.de> List-Id: --===============3109667512559240669== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Mon 2020-07-27 14:00:00, John Ogness wrote: > On 2020-07-22, kernel test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next= .git master > > head: de2e69cfe54a8f2ed4b75f09d3110c514f45d38e > > commit: 896fbe20b4e2333fb55cc9b9b783ebcc49eee7c7 [6188/10009] printk: u= se the lockless ringbuffer > > config: h8300-randconfig-c022-20200720 (attached as .config) > > compiler: h8300-linux-gcc (GCC) 9.3.0 > > reproduce (this is a W=3D1 build): > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/s= bin/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=3D$HOME/0day COMPILER=3Dgcc-9.3.0 make.cr= oss ARCH=3Dh8300 = > > > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > > > All errors (new ones prefixed by >>): > > > > h8300-linux-ld: section .init.text LMA [00000000005eaf40,00000000006= 2100b] 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,0000= 000000794597] 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. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [*] 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 # =3D> metadata: 14 kB $> cat /dev/kmsg >/tmp/dev_kmsg $> cat /tmp/dev_kmsg | grep caller=3D | cut -d: -f2- | sed -e "s/^.*caller= =3DT1;//" | wc -c 30997 # =3D> text: 30 kB $> cat /tmp/dev_kmsg | grep -v caller=3D | wc -c 9293 # =3D> dict: 9 kB Best Regards, Petr --===============3109667512559240669==--