linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Minchan Kim <minchan@kernel.org>
To: Michal Hocko <mhocko@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Matthew Wilcox <willy@infradead.org>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mm/madvise: add vmstat statistics for madvise_[cold|pageout]
Date: Wed, 25 Jan 2023 14:21:35 -0800	[thread overview]
Message-ID: <Y9Grb2rggptkCu+n@google.com> (raw)
In-Reply-To: <Y9GhNxqfjTEAFr5V@dhcp22.suse.cz>

On Wed, Jan 25, 2023 at 10:37:59PM +0100, Michal Hocko wrote:
> On Wed 25-01-23 10:07:49, Minchan Kim wrote:
> > On Wed, Jan 25, 2023 at 06:07:00PM +0100, Michal Hocko wrote:
> > > On Wed 25-01-23 08:36:02, Minchan Kim wrote:
> > > > On Wed, Jan 25, 2023 at 09:04:16AM +0100, Michal Hocko wrote:
> > > > > On Tue 24-01-23 16:54:57, Minchan Kim wrote:
> > > > > > madvise LRU manipulation APIs need to scan address ranges to find
> > > > > > present pages at page table and provides advice hints for them.
> > > > > > 
> > > > > > Likewise pg[scan/steal] count on vmstat, madvise_pg[scanned/hinted]
> > > > > > shows the proactive reclaim efficiency so this patch adds those
> > > > > > two statistics in vmstat.
> > > > > > 
> > > > > > 	madvise_pgscanned, madvise_pghinted
> > > > > > 
> > > > > > Since proactive reclaim using process_madvise(2) as userland
> > > > > > memory policy is popular(e.g,. Android ActivityManagerService),
> > > > > > those stats are helpful to know how efficiently the policy works
> > > > > > well.
> > > > > 
> > > > > The usecase description is still too vague. What are those values useful
> > > > > for? Is there anything actionable based on those numbers? How do you
> > > > > deal with multiple parties using madvise resp. process_madvise so that
> > > > > their stats are combined?
> > > > 
> > > > The metric helps monitoing system MM health under fleet and experimental
> > > > tuning with diffrent policies from the centralized userland memory daemon.
> > > 
> > > That is just too vague for me to imagine anything more specific then, we
> > > have numbers and we can show them in a report. What does it actually
> > > mean that madvise_pgscanned is high. Or that pghinted / pgscanned is
> > > low (that you tend to manually reclaim sparse mappings)?
> > 
> > If that's low, it means the userspace daemon's current tune/policy are
> > inefficient or too aggressive since it is working on address spacess
> > of processes which don't have enough memory the hint can work(e.g.,
> > shared addresses, cold address ranges or some special address ranges like
> > VM_PFNMAP) so sometime, we can detect regression to find culprit or
> > have a chance to look into better ideas to improve.
> 
> Are you sure this is really meaningful metric? Just consider a large and
> sparsely populated mapping. This can be a perfect candidate for user
> space reclaim target (e.g. consider a mapping covering a large matrix
> or other similar data structure). pghinted/pgscanned would be really
> small while the reclaim efficiency could be quite high in that case,
> wouldn't it?

Why do you think it's efficient? It need to spend quite CPU cycle to
scan a few of pages to evict. I don't see it's efficient if it happens
quite a lot.


  reply	other threads:[~2023-01-25 22:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25  0:54 Minchan Kim
2023-01-25  8:04 ` Michal Hocko
2023-01-25 16:36   ` Minchan Kim
2023-01-25 17:07     ` Michal Hocko
2023-01-25 18:07       ` Minchan Kim
2023-01-25 21:37         ` Michal Hocko
2023-01-25 22:21           ` Minchan Kim [this message]
2023-01-26  8:50             ` Michal Hocko
2023-01-26  8:51               ` Michal Hocko
2023-01-26 17:10               ` Minchan Kim
2023-01-26 19:58                 ` Michal Hocko
2023-01-27  0:08                   ` Minchan Kim
2023-01-27  9:48                     ` Michal Hocko
2023-01-28  3:00                       ` Minchan Kim
2023-01-30 11:12                         ` Michal Hocko

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=Y9Grb2rggptkCu+n@google.com \
    --to=minchan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=surenb@google.com \
    --cc=willy@infradead.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