linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: Debug: mm: meminfo reports 222GiB of AnonPages but sum of RSS in ps is barely 400MiB
       [not found] <CA+uifjNcZbb6=9-o9_cWCMyXRFZPHhyvWS2mys-YhfP9gaJ75w@mail.gmail.com>
@ 2024-01-17 14:15 ` David Hildenbrand
       [not found]   ` <CA+uifjNw0W=EaUHbhq_CN8uOj0H_Yfu9JKSL1=EH6dnYkN3-ng@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: David Hildenbrand @ 2024-01-17 14:15 UTC (permalink / raw)
  To: Karim Manaouil, linux-kernel; +Cc: linux-mm

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Debug: mm: meminfo reports 222GiB of AnonPages but sum of RSS in ps is barely 400MiB
       [not found]   ` <CA+uifjNw0W=EaUHbhq_CN8uOj0H_Yfu9JKSL1=EH6dnYkN3-ng@mail.gmail.com>
@ 2024-01-17 15:53     ` David Hildenbrand
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2024-01-17 15:53 UTC (permalink / raw)
  To: Karim Manaouil; +Cc: linux-kernel, linux-mm

On 17.01.24 16:50, Karim Manaouil wrote:
> On Wed, Jan 17, 2024 at 2:15 PM David Hildenbrand <david@redhat.com> wrote:
> 
>> Maybe we have something call mmget(mm) but never mmput(mm)? Are you
>> running any OOT drivers or "special" hw?
> 
> That's exactly the reason! I was writing some code to count the number
> of empty page tables in the system
> at any given point in time. I called get_task_mm(), but I forgot to
> call mmput() after that, and thus
> the memory was never released.

If you want to work on reclaiming empty page tables, please talk to me :D

-- 
Cheers,

David / dhildenb



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-17 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CA+uifjNcZbb6=9-o9_cWCMyXRFZPHhyvWS2mys-YhfP9gaJ75w@mail.gmail.com>
2024-01-17 14:15 ` Debug: mm: meminfo reports 222GiB of AnonPages but sum of RSS in ps is barely 400MiB David Hildenbrand
     [not found]   ` <CA+uifjNw0W=EaUHbhq_CN8uOj0H_Yfu9JKSL1=EH6dnYkN3-ng@mail.gmail.com>
2024-01-17 15:53     ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox