linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Karim Manaouil <kmanaouil.dev@gmail.com>, linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
Subject: Re: Debug: mm: meminfo reports 222GiB of AnonPages but sum of RSS in ps is barely 400MiB
Date: Wed, 17 Jan 2024 15:15:36 +0100	[thread overview]
Message-ID: <97843013-7e06-449c-8418-3890657b2e26@redhat.com> (raw)
In-Reply-To: <CA+uifjNcZbb6=9-o9_cWCMyXRFZPHhyvWS2mys-YhfP9gaJ75w@mail.gmail.com>

On 17.01.24 12:39, Karim Manaouil wrote:
> Hi,
> 
> My system says that 231GiB is used out of 251GiB, but when I try to find the
> processes using this memory in htop or ps, I find nothing. In fact, the sum
> of RSS memory across all processes listed in ps (both user and kernel process)
> is barely 400MiB.

Hi,

which kernel are you running? Which debug options are enabled in the config?

> 
> A look at Meminfo shows that 222GiB of memory is AnonPages.
> With the help of `numastat -m`, it is inactive anonymous, more precisely.
> 
> I am really baffled and I have no idea who is using my memory?!!
> 

If it would only be "used", I would have suspected PCP lists. But if the 
memory shows up as AnonPages in /proc/meminfo, that memory should 
actually still be mapped into some MM.

> Here is what `free -h` is reporting.
> 
> karim@luna:~/mem_debug$ free -h
>                total        used        free      shared  buff/cache   available
> Mem:           251Gi       231Gi       1.1Gi        52Mi        21Gi        20Gi
> Swap:          119Gi        75Gi        43Gi
> 
> And this is meminfo:
> 
> karim@luna:~/mem_debug$ grep AnonPages /proc/meminfo
> AnonPages:      222998596 kB

IIRC, the last one to drop mm->mm_users will call exit_mmap(), which 
will unmap all pages (making AnonPages go down) and free the memory 
(making used memory go down).

Maybe we have something call mmget(mm) but never mmput(mm)? Are you 
running any OOT drivers or "special" hw?

-- 
Cheers,

David / dhildenb



       reply	other threads:[~2024-01-17 14:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+uifjNcZbb6=9-o9_cWCMyXRFZPHhyvWS2mys-YhfP9gaJ75w@mail.gmail.com>
2024-01-17 14:15 ` David Hildenbrand [this message]
     [not found]   ` <CA+uifjNw0W=EaUHbhq_CN8uOj0H_Yfu9JKSL1=EH6dnYkN3-ng@mail.gmail.com>
2024-01-17 15:53     ` David Hildenbrand

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=97843013-7e06-449c-8418-3890657b2e26@redhat.com \
    --to=david@redhat.com \
    --cc=kmanaouil.dev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox