linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sjpark@amazon.com>
To: Shakeel Butt <shakeelb@google.com>
Cc: SeongJae Park <sjpark@amazon.com>, <Jonathan.Cameron@huawei.com>,
	"Andrea Arcangeli" <aarcange@redhat.com>, <acme@kernel.org>,
	<alexander.shishkin@linux.intel.com>, <amit@kernel.org>,
	<benh@kernel.crashing.org>, <brendan.d.gregg@gmail.com>,
	Brendan Higgins <brendanhiggins@google.com>,
	Qian Cai <cai@lca.pw>, Colin Ian King <colin.king@canonical.com>,
	Jonathan Corbet <corbet@lwn.net>,
	"David Hildenbrand" <david@redhat.com>, <dwmw@amazon.com>,
	"Du, Fan" <fan.du@intel.com>, <foersleo@amazon.de>,
	Greg Thelen <gthelen@google.com>, Ian Rogers <irogers@google.com>,
	<jolsa@redhat.com>, "Kirill A. Shutemov" <kirill@shutemov.name>,
	<mark.rutland@arm.com>, Mel Gorman <mgorman@suse.de>,
	Minchan Kim <minchan@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	<namhyung@kernel.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Rik van Riel <riel@surriel.com>,
	David Rientjes <rientjes@google.com>,
	Steven Rostedt <rostedt@goodmis.org>, <rppt@kernel.org>,
	<sblbir@amazon.com>, <shuah@kernel.org>, <sj38.park@gmail.com>,
	<snu@amazon.de>, Vlastimil Babka <vbabka@suse.cz>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Yang Shi <yang.shi@linux.alibaba.com>,
	Huang Ying <ying.huang@intel.com>, <zgf574564920@gmail.com>,
	<linux-damon@amazon.com>, Linux MM <linux-mm@kvack.org>,
	<linux-doc@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC v7 00/10] DAMON: Support Physical Memory Address Space Monitoring
Date: Thu, 20 Aug 2020 19:33:10 +0200	[thread overview]
Message-ID: <20200820173310.18933-1-sjpark@amazon.com> (raw)
In-Reply-To: <CALvZod7a=zr8VX3T2KOheUJ-THjGz=O+JBdcjw4iraN3m9jSJg@mail.gmail.com>

On Thu, 20 Aug 2020 08:44:33 -0700 Shakeel Butt <shakeelb@google.com> wrote:

> On Thu, Aug 20, 2020 at 12:11 AM SeongJae Park <sjpark@amazon.com> wrote:
> >
> > On Wed, 19 Aug 2020 18:21:44 -0700 Shakeel Butt <shakeelb@google.com> wrote:
> >
> > > On Tue, Aug 18, 2020 at 12:25 AM SeongJae Park <sjpark@amazon.com> wrote:
> > > >
> > > > From: SeongJae Park <sjpark@amazon.de>
> > > >
> > > > Changes from Previous Version
> > > > =============================
> > > >
> > > > - Use 42 as the fake target id for paddr instead of -1
> > > > - Fix a typo
> > > >
> > > > Introduction
> > > > ============
> > > >
> > > > DAMON[1] programming interface users can extend DAMON for any address space by
> > > > configuring the address-space specific low level primitives with appropriate
> > > > ones including their own implementations.  However, because the implementation
> > > > for the virtual address space is only available now, the users should implement
> > > > their own for other address spaces.  Worse yet, the user space users who rely
> > > > on the debugfs interface and user space tool, cannot implement their own.
> > > >
> > > > This patchset implements another reference implementation of the low level
> > > > primitives for the physical memory address space.  With this change, hence, the
> > > > kernel space users can monitor both the virtual and the physical address spaces
> > > > by simply changing the configuration in the runtime.  Further, this patchset
> > > > links the implementation to the debugfs interface and the user space tool for
> > > > the user space users.
> > > >
> > > > Note that the implementation supports only the user memory, as same to the idle
> > > > page access tracking feature.
> > > >
> > > > [1] https://lore.kernel.org/linux-mm/20200706115322.29598-1-sjpark@amazon.com/
> > > >
> > >
> > > I am still struggling to find the benefit of this feature the way it
> > > is implemented i.e. region based physical address space monitoring.
> > > What exactly am I supposed to do for a given hot (or cold) physical
> > > region? In a containerized world, that region can contain pages from
> > > any cgroup. I can not really do anything about the accesses PHY-DAMON
> > > provides me for a region.
> >
> > Technically speaking, this patchset introduces an implementation of DAMON's low
> > level primitives for physical address space of LRU-listed pages.  In other
> > words, it is not designed for cgroups case.
> 
> So, this RFC is for a system running a single workload which comprises
> multiple processes. Instead of registering each process with DAMON,
> just monitor the whole physical memory, right?

Right.  Also I assumed the kernel space DAMON users as the primary users of
this feature.

> 
> Though I am still not sure how the output from DAMON can be used in
> this case. DAMON told me a physical region is cold, how do I find out
> processes that have mapped the pages in that region to do
> process_madvise(PAGEOUT) on them?

Seems you are saying about the user space DAMON use.  Indeed, it would be quite
complicated.  For example, maybe the user space could read '/proc/pid/pagemap'
of every process, but this really sounds awkward.  Thank you for pointing this
:)  Even in the virtual address case, it could be complicated.

For this reason, I am developing DAMON-based Operation Schemes[1].  It is
designed to do the monitoring and optimization of specific regions fit in
special monitoring result by DAMON itself.  Nonetheless, current version of it
supports only virtual address spaces.  A support of physical address space from
the feature will be another future work.

If the user space really need to do that by itself, we could provide the
physical address to virtual address mapping info in addition to the monitoring
result in future.

And, yes, we have so many TODO tasks that really necessary.  I will eventually
do all of those, but also concerning about my limited time.  Nevertheless, I
believe it would better to focus on the core of DAMON[2] for now and continue
further TODO tasks after it is merged in the mainline, because maintainance of
the code will be much easier and hopefully more developers could collaborate
for the many TODO tasks.

[1] https://lore.kernel.org/linux-mm/20200804142430.15384-1-sjpark@amazon.com/
[2] https://lore.kernel.org/linux-mm/20200817105137.19296-1-sjpark@amazon.com/


Thanks,
SeongJae Park


      reply	other threads:[~2020-08-20 17:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18  7:24 [RFC v7 00/10] DAMON: Support Physical Memory Address Space Monitoring SeongJae Park
2020-08-18  7:24 ` [RFC v7 01/10] mm/damon/debugfs: Allow users to set initial monitoring target regions SeongJae Park
2020-08-18  7:24 ` [RFC v7 02/10] tools/damon: Support init target regions specification SeongJae Park
2020-08-18  7:24 ` [RFC v7 03/10] mm/damon-test: Add more unit tests for 'init_regions' SeongJae Park
2020-08-18 19:22   ` Brendan Higgins
2020-08-18  7:24 ` [RFC v7 04/10] selftests/damon/_chk_record: Do not check number of gaps SeongJae Park
2020-08-18  7:24 ` [RFC v7 05/10] Docs/admin-guide/mm/damon: Document 'init_regions' feature SeongJae Park
2020-08-18  7:24 ` [RFC v7 06/10] mm/damon: Implement callbacks for physical memory monitoring SeongJae Park
2020-08-20  0:26   ` Shakeel Butt
2020-08-20  7:16     ` SeongJae Park
2020-08-20 13:26       ` Shakeel Butt
2020-08-20 14:28         ` SeongJae Park
2020-08-28  8:11   ` Alkaid
2020-08-28  9:53     ` SeongJae Park
2020-08-28 11:39       ` SeongJae Park
2020-08-18  7:24 ` [RFC v7 07/10] mm/damon/debugfs: Support " SeongJae Park
2020-08-18  7:24 ` [RFC v7 08/10] tools/damon/record: " SeongJae Park
2020-08-18  7:25 ` [RFC v7 09/10] tools/damon/record: Support NUMA specific recording SeongJae Park
2020-08-18  7:25 ` [RFC v7 10/10] Docs/DAMON: Document physical memory monitoring support SeongJae Park
2020-08-20  1:21 ` [RFC v7 00/10] DAMON: Support Physical Memory Address Space Monitoring Shakeel Butt
2020-08-20  7:10   ` SeongJae Park
2020-08-20 15:44     ` Shakeel Butt
2020-08-20 17:33       ` SeongJae Park [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=20200820173310.18933-1-sjpark@amazon.com \
    --to=sjpark@amazon.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=aarcange@redhat.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=amit@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=brendan.d.gregg@gmail.com \
    --cc=brendanhiggins@google.com \
    --cc=cai@lca.pw \
    --cc=colin.king@canonical.com \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=dwmw@amazon.com \
    --cc=fan.du@intel.com \
    --cc=foersleo@amazon.de \
    --cc=gthelen@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=kirill@shutemov.name \
    --cc=linux-damon@amazon.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mark.rutland@arm.com \
    --cc=mgorman@suse.de \
    --cc=minchan@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=riel@surriel.com \
    --cc=rientjes@google.com \
    --cc=rostedt@goodmis.org \
    --cc=rppt@kernel.org \
    --cc=sblbir@amazon.com \
    --cc=shakeelb@google.com \
    --cc=shuah@kernel.org \
    --cc=sj38.park@gmail.com \
    --cc=snu@amazon.de \
    --cc=vbabka@suse.cz \
    --cc=vdavydov.dev@gmail.com \
    --cc=yang.shi@linux.alibaba.com \
    --cc=ying.huang@intel.com \
    --cc=zgf574564920@gmail.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).