All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Cc: Michal Hocko <mhocko@kernel.org>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mgorman@suse.de>,
	 Balbir Singh <bsingharora@gmail.com>,
	 Peter Zijlstra <peterz@infradead.org>,
	linux-mm@kvack.org
Subject: Re: Tools for explaining memory mappings/usage/pressure
Date: Mon, 22 Jul 2024 14:57:57 -0700 (PDT)	[thread overview]
Message-ID: <fba2dbce-d4e2-a838-2f17-aa1592787bd4@google.com> (raw)
In-Reply-To: <549a3199-2eb5-41b1-a03b-9cc571e72e03@kernel.org>

On Mon, 22 Jul 2024, Vlastimil Babka (SUSE) wrote:

> On 7/6/24 10:55 PM, David Rientjes wrote:
> > Hi all,
> > 
> > I'm trying to crowdsource information on open source tools that can be 
> > used directly by customers to explain memory mappings, usage, pressure, 
> > etc.
> > 
> > We encounter both internal and external users that are looking for this 
> > insight and it often requires significant engineering time to collect data 
> > to make any conclusions.
> > 
> > A recent example is an external customer that recently upgraded their 
> > userspace and started to run into memcg constrained memory pressure that 
> > wasn't previously observed.  After handing off a hacky script to run in 
> > the background, it was immediately obvious that the source of the direct 
> > reclaim was all of the MADV_FREE memory that was sitting around.  
> > Converting to MADV_DONTNEED solved their issue.
> 
> BTW, was this reported/fixed upstream? Sounds like a bug to me that would
> better be fixed than suggesting the MADV_DONTNEED workaround to everyone
> from now on.
> 

From the kernel perspective, it was working as intended: nearly half of 
the customer's memory (32GB VM instance) was lazily freeable under memory 
pressure and they were not expecting any reclaim stalls for future page 
faults.  A recent upgrade of their userspace had switched heap freeing in 
a library from MADV_DONTNEED -> MADV_FREE implicitly without the user's 
direct knowledge :/


  reply	other threads:[~2024-07-22 21:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-06 20:55 Tools for explaining memory mappings/usage/pressure David Rientjes
2024-07-07 15:44 ` SeongJae Park
2024-07-08 13:50 ` Dan Schatzberg
2024-07-21 23:05   ` David Rientjes
2024-07-22 22:15     ` Dan Schatzberg
2024-07-22  9:05 ` Vlastimil Babka (SUSE)
2024-07-22 21:57   ` David Rientjes [this message]
2024-12-30  8:15 ` Raghavendra K T

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=fba2dbce-d4e2-a838-2f17-aa1592787bd4@google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=bsingharora@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@kernel.org \
    --cc=peterz@infradead.org \
    --cc=vbabka@kernel.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.