linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Chris Murphy <lists@colorremedies.com>
Cc: Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: 5.11 "debug" missing 20-30% memory, and exceptionally high reserved
Date: Mon, 1 Feb 2021 12:08:21 +0100	[thread overview]
Message-ID: <36a0571e-806a-c532-09c5-438c3a67dccf@redhat.com> (raw)
In-Reply-To: <CAJCQCtS8fXCVsyvoRW24pxZm56wMwQyOei5P9BLYFt9FHhwy7w@mail.gmail.com>

On 31.01.21 00:21, Chris Murphy wrote:
> On Sat, Jan 30, 2021 at 11:48 AM Chris Murphy <lists@colorremedies.com> wrote:
> 
>> Bug 1921923 - Kernel under-reporting or hiding about a third of
>> available memory in "debug" 5.11 series
>> https://bugzilla.redhat.com/show_bug.cgi?id=1921923
> 
> Looks like it's newy enabled CONFIG_KASAN options. The issue doesn't
> happen when these are disabled:
> 
> -CONFIG_KASAN_SHADOW_OFFSET=0xdffffc0000000000
> -CONFIG_KASAN=y
> -CONFIG_KASAN_GENERIC=y
> -CONFIG_KASAN_INLINE=y
> -CONFIG_KASAN_STACK=1
> -CONFIG_KASAN_VMALLOC=y

https://static.lwn.net/kerneldoc/dev-tools/kasan.html

"The state of each 8 aligned bytes of memory is encoded in one shadow 
byte." - Memory overhead of 1/8, which matches what you report.

As that memory is allocated early during boot, it's never managed by the 
buddy and therefore not accounted towards MemTotal.

One could adjust MemTotal accounting in the kernel using 
adjust_managed_pages() from kasan code, but why should we really bother 
about fixing up accounting for debug kernels.

This debug option comes with a big price tag on it. Be careful when 
enabling it.

-- 
Thanks,

David / dhildenb



      reply	other threads:[~2021-02-01 11:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-30 18:48 5.11 "debug" missing 20-30% memory, and exceptionally high reserved Chris Murphy
2021-01-30 23:21 ` Chris Murphy
2021-02-01 11:08   ` David Hildenbrand [this message]

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=36a0571e-806a-c532-09c5-438c3a67dccf@redhat.com \
    --to=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=lists@colorremedies.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).