The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: SJ Park <sj@kernel.org>
Cc: Bharata B Rao <bharata@amd.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Jonathan.Cameron@huawei.com, dave.hansen@intel.com,
	gourry@gourry.net, mgorman@techsingularity.net, mingo@redhat.com,
	peterz@infradead.org, raghavendra.kt@amd.com, riel@surriel.com,
	rientjes@google.com, weixugc@google.com, willy@infradead.org,
	ying.huang@linux.alibaba.com, ziy@nvidia.com, dave@stgolabs.net,
	nifan.cxl@gmail.com, xuezhengchu@huawei.com, yiannis@zptcorp.com,
	david@kernel.org, byungchul@sk.com, kinseyho@google.com,
	joshua.hahnjy@gmail.com, yuanchu@google.com, balbirs@nvidia.com,
	alok.rathore@samsung.com, shivankg@amd.com,
	donettom@linux.ibm.com
Subject: Re: [PATCH v8 0/8] mm: Hot page tracking and promotion infrastructure
Date: Mon,  3 Aug 2026 18:23:55 -0700	[thread overview]
Message-ID: <20260804012356.88861-1-sj@kernel.org> (raw)
In-Reply-To: <20260729135419.87239-1-sj@kernel.org>

On Wed, 29 Jul 2026 06:54:18 -0700 SJ Park <sj@kernel.org> wrote:

> On Wed, 29 Jul 2026 15:05:10 +0530 Bharata B Rao <bharata@amd.com> wrote:
> 
> > On 28-Jul-26 11:44 PM, Andrew Morton wrote:
> > > On Tue, 28 Jul 2026 11:13:48 +0530 Bharata B Rao <bharata@amd.com> wrote:
> > > 
> > >> This patchset introduces pghot, a subsystem for hot page tracking and
> > >> promotion.
> > > 
> > > Can DAMON be used to do this sort of thing adequately?
> > 
> > That really depends on the goal I believe, let me expand...
> 
> Thank you Bharata, this clearly explains me your view.  I find a few little
> gaps between yours and mine, though.  Let me clarify below.
> 
> > 
> > DAMON can indeed migrate hot pages today via DAMOS_MIGRATE_HOT, and
> > IIUC it can even do promotion and demotion together that auto-tunes
> > to a target node utilization. So for someone who wants to write a
> > per-workload, per-process tiering policy from user space, DAMON is a
> > good fit and I don't think pghot competes with it there.
> > 
> > But the intent behind pghot isn't really to be another migration
> > policy. It is to build a common in-kernel infrastructure that can act
> > as a single promotion subsystem, fed by multiple sources, with the
> > promotion engine and its heuristics (rate limiting, dynamic threshold)
> > living in one place rather than in the scheduler. Hint faults are just
> > the first source. The IBS Memory Profiler, which gives access
> > information directly from the hardware, is the other one. CXL HMU can be
> > another potential source. Hence the design centers on an exact, per-PFN
> > record that any of these sources can update, rather than on sampling.
> > 
> > The per-page, source-driven model is where the two differ the most.
> > DAMON estimates hotness by sampling one page per region per interval,
> > which is low overhead and self-contained, but it may miss a hot page
> > inside a region.
> 
> DAMON can do [1] fixed granularity monitoring, down to page size.  Of course it
> increases overhead.  A few people are using DAMON in this way, though, and we
> are working together to optimize it.
> 
> > pghot records every reported access at PFN granularity,
> > so it does not miss, but in turn it relies on a source to report the access.
> 
> DAMON is not designed to use only the single source.  We started working [2] on
> extending DAMON for multiple sources including AMD IBS.  A few working
> prototpyes are shared.  We plan to share the first version at next LSFMMBPF.
> 
> > 
> > The other practical difference is that pghot works with no user-space
> > agent at all. With numa_balancing=2 the promotion just happens, and in
> > fact pghot takes over the mode-2 promotion path that currently sits in
> > the scheduler. DAMON, outside of its built-in modules, expects a
> > controller in user space to drive it, IIUC.
> 
> For a level of auto-tuned hot/cold pages promotion/demotion, DAMON-based memory
> tiering doesn't require user-space agent, either.  Only a number of simple
> sysfs file writes are needed at the beginning.
> 
> > 
> > So I would see DAMON and pghot as complementary rather than one replacing
> > the other.
> 
> I have no strong opinion.
> 
> > In fact DAMON could well become one of the sources feeding
> > pghot, and conversely pghot's batched, rate-limited engine could serve
> > as a migration backend.

One thing to add for clarification.  DAMON is not only for monitoring.  It also
provides a general access pattern based operation engine, a.k.a DAMOS.  It
provides auto-tuned rate limiting (a.k.a DAMOS quota) and flexible filtering.

Hence, yet another imaginable way of the collaboration is plugging things in
the opposite way.  pghot's multi-source access monitoring becomes additional
access check primitives feeding DAMON, and DAMON serves as a migration backend
with its auto-tuned rate limiting and filtering.  I proposed
damon_report_access() in LSFMMBPF'25, suggesting this kind of collaboration as
one of possible use cases.

> 
> Makes sense to me.  If there are needs, we are open to add new DAMON APIs.
> 
> [1] https://origin.kernel.org/doc/html/latest/mm/damon/faq.html#can-i-simply-monitor-page-granularity
> [2] https://lore.kernel.org/all/20260525225208.1179-1-sj@kernel.org/
> 
> 
> Thanks,
> SJ
> 
> [...]
> 


Thanks,
SJ

  reply	other threads:[~2026-08-04  1:24 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28  5:43 [PATCH v8 0/8] mm: Hot page tracking and promotion infrastructure Bharata B Rao
2026-07-28  5:43 ` [PATCH v8 1/8] mm: migrate: Allow misplaced migration without VMA Bharata B Rao
2026-07-28  5:43 ` [PATCH v8 2/8] mm: migrate: Add promote_misplaced_memcg_folios() Bharata B Rao
2026-07-30  6:34   ` Bharata B Rao
2026-07-28  5:43 ` [PATCH v8 3/8] mm: Hot page tracking and promotion - pghot Bharata B Rao
2026-07-31 16:14   ` Bharata B Rao
2026-07-28  5:43 ` [PATCH v8 4/8] mm: pghot: Precision mode for pghot Bharata B Rao
2026-07-31 16:27   ` Bharata B Rao
2026-07-28  5:43 ` [PATCH v8 5/8] mm: sched: move NUMA balancing tiering promotion to pghot Bharata B Rao
2026-08-03  8:23   ` Bharata B Rao
2026-07-28  5:43 ` [PATCH v8 6/8] x86/ibs: Move IBS caps definitions into its own header Bharata B Rao
2026-07-28  5:43 ` [PATCH v8 7/8] x86/mm/ibs: In-kernel driver for AMD IBS Memory Profiler Bharata B Rao
2026-08-04  5:00   ` Bharata B Rao
2026-07-28  5:43 ` [PATCH v8 8/8] x86/mm/ibs: Add runtime controls for IBS memprofiler Bharata B Rao
2026-08-04  5:20   ` Bharata B Rao
2026-07-28  5:55 ` [PATCH v8 0/8] mm: Hot page tracking and promotion infrastructure - microbenchmark numbers Bharata B Rao
2026-07-28  5:59 ` [PATCH v8 0/8] mm: Hot page tracking and promotion infrastructure - NAS BT Bharata B Rao
2026-07-28  6:02 ` [PATCH v8 0/8] mm: Hot page tracking and promotion infrastructure - Graph500 Bharata B Rao
2026-07-28  6:05 ` [PATCH v8 0/8] mm: Hot page tracking and promotion infrastructure - redis-memtier Bharata B Rao
2026-07-28  6:17 ` [PATCH v8 0/8] mm: Hot page tracking and promotion infrastructure - llama-bench Bharata B Rao
2026-07-28 18:14 ` [PATCH v8 0/8] mm: Hot page tracking and promotion infrastructure Andrew Morton
2026-07-28 18:24   ` Matthew Wilcox
2026-07-28 18:57     ` Gregory Price
2026-07-28 19:20       ` David Hildenbrand (Arm)
2026-07-28 19:59         ` Gregory Price
2026-07-29 11:45         ` Bharata B Rao
2026-07-29  9:35   ` Bharata B Rao
2026-07-29 13:54     ` SJ Park
2026-08-04  1:23       ` SJ Park [this message]
2026-08-06  5:49   ` Bharata B Rao
2026-08-06 13:44     ` SJ Park

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=20260804012356.88861-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=alok.rathore@samsung.com \
    --cc=balbirs@nvidia.com \
    --cc=bharata@amd.com \
    --cc=byungchul@sk.com \
    --cc=dave.hansen@intel.com \
    --cc=dave@stgolabs.net \
    --cc=david@kernel.org \
    --cc=donettom@linux.ibm.com \
    --cc=gourry@gourry.net \
    --cc=joshua.hahnjy@gmail.com \
    --cc=kinseyho@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@redhat.com \
    --cc=nifan.cxl@gmail.com \
    --cc=peterz@infradead.org \
    --cc=raghavendra.kt@amd.com \
    --cc=riel@surriel.com \
    --cc=rientjes@google.com \
    --cc=shivankg@amd.com \
    --cc=weixugc@google.com \
    --cc=willy@infradead.org \
    --cc=xuezhengchu@huawei.com \
    --cc=yiannis@zptcorp.com \
    --cc=ying.huang@linux.alibaba.com \
    --cc=yuanchu@google.com \
    --cc=ziy@nvidia.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