All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Shi <shy828301@gmail.com>
To: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: kernel 5.10.x Reserves much more RAM than 5.11.0, 8 MB vs 20 MB
Date: Wed, 27 Oct 2021 10:12:41 -0700	[thread overview]
Message-ID: <CAHbLzkpfd4SYESWhoYYpfrzveJbErYCJQuFhqjcqMZ59+gQJcw@mail.gmail.com> (raw)
In-Reply-To: <71b597cb9a89c9f033861513da393501f04f4098.camel@infinera.com>

On Wed, Oct 27, 2021 at 5:48 AM Joakim Tjernlund
<Joakim.Tjernlund@infinera.com> 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.


  parent reply	other threads:[~2021-10-27 17:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 12:48 kernel 5.10.x Reserves much more RAM than 5.11.0, 8 MB vs 20 MB Joakim Tjernlund
2021-10-27 12:57 ` David Hildenbrand
2021-10-27 13:20   ` Joakim Tjernlund
2021-10-27 13:35 ` Matthew Wilcox
2021-10-27 13:41   ` Joakim Tjernlund
2021-10-27 14:17     ` David Hildenbrand
2021-10-27 14:50       ` Joakim Tjernlund
2021-10-27 17:12 ` Yang Shi [this message]
2021-10-28  9:55   ` Joakim Tjernlund
2021-10-28 21:52     ` Yang Shi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHbLzkpfd4SYESWhoYYpfrzveJbErYCJQuFhqjcqMZ59+gQJcw@mail.gmail.com \
    --to=shy828301@gmail.com \
    --cc=Joakim.Tjernlund@infinera.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.