On Wed, Oct 27, 2021 at 5:48 AM Joakim Tjernlund <Joakim.Tjernlund@xxxxxxxxxxxx> wrote: > > Using a fairly minimal kernel I get a big difference in Reserved memory, using: > qemu-system-aarch64 -machine virt -kernel arch/arm64/boot/Image -cpu cortex-a53 -nographic -m 32M > > I get this: > Linux version 5.11.0 > Memory: 24052K/32768K available (3520K kernel code, 684K rwdata, 548K rodata, 320K init, 245K bss, 8716K reserved, 0K cma-reserved) > > Versus: > > Linux version 5.10.75 > Memory: 11836K/32768K available (3518K kernel code, 684K rwdata, 540K rodata, 320K init, 244K bss, 20932K reserved, 0K cma-reserved) > > Reserving 20 MB RAM on a 32 MB is way too much, even 8Mb is a bit much for us. This might be caused by the new lockless printk buffer patch introduced in 5.10. We noticed this spike on 5.10 kernel too. It may have much more memory reserved for meta data and the total amount may be as much as 3x of log_buf_len. The amount varies on different platforms with different configs. I didn't dig too much into the details to figure out how it gets the number. You could try to adjust CONFIG_LOG_BUF_SHIFT or set log_buf_len from kernel commandline to limit the printk buffer size. > > Jocke > > PS. I hope this is the right list, please advise if it is not.