All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Ravi Jonnalagadda <ravis.opensrc@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
	damon@lists.linux.dev, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	akpm@linux-foundation.org, corbet@lwn.net, bijan311@gmail.com,
	ajayjoshi@micron.com, honggyu.kim@sk.com, yunjeong.mun@sk.com
Subject: Re: [RFC PATCH v4 1/1] mm/damon: add node_eligible_mem_bp and node_ineligible_mem_bp goal metrics
Date: Mon, 23 Mar 2026 16:54:36 -0700	[thread overview]
Message-ID: <20260323235438.85953-1-sj@kernel.org> (raw)
In-Reply-To: <CALa+Y16i0f5D_ZTVcfVa1DgeZL1btvUJxjOvoyFEYNkT7K-grg@mail.gmail.com>

On Mon, 23 Mar 2026 12:41:42 -0700 Ravi Jonnalagadda <ravis.opensrc@gmail.com> wrote:

> On Sat, Mar 21, 2026 at 9:54 AM SeongJae Park <sj@kernel.org> wrote:
> >
> > On Fri, 20 Mar 2026 12:04:53 -0700 Ravi Jonnalagadda <ravis.opensrc@gmail.com> wrote:
> >
> > > Add new quota goal metrics for memory tiering that track scheme-eligible
> > > memory distribution across NUMA nodes:
> > >
> > > - DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP: ratio of eligible memory on a node
> > > - DAMOS_QUOTA_NODE_INELIGIBLE_MEM_BP: ratio of eligible memory NOT on
> > >   a node
> >
> > The description for the second metric should be "ratio of ineligible memory on
> > a node".
> >
> 
> Got it. Will fix the commit message.
> 
> > >
> > > These complementary metrics enable push-pull migration schemes that
> > > maintain a target memory distribution across different NUMA nodes
> > > representing different memory tiers, based on access patterns defined
> > > by each scheme.
> > >
> > > The metrics iterate scheme-eligible regions and use damon_get_folio()
> > > to determine NUMA node placement of each folio, calculating the ratio
> > > of eligible memory on the specified node versus total eligible memory.
> > >
> > > Suggested-by: SeongJae Park <sj@kernel.org>
> > > Signed-off-by: Ravi Jonnalagadda <ravis.opensrc@gmail.com>
> > > ---
> > >  include/linux/damon.h    |   6 ++
> > >  mm/damon/core.c          | 158 ++++++++++++++++++++++++++++++++++++---
> > >  mm/damon/sysfs-schemes.c |  12 +++
> > >  3 files changed, 164 insertions(+), 12 deletions(-)
> > >
> > > diff --git a/include/linux/damon.h b/include/linux/damon.h
> > > index b1d8fd88a0fc..490918804f85 100644
> > > --- a/include/linux/damon.h
> > > +++ b/include/linux/damon.h
> > > @@ -193,6 +193,10 @@ enum damos_action {
> > >   * @DAMOS_QUOTA_NODE_MEMCG_FREE_BP:  MemFree ratio of a node for a cgroup.
> > >   * @DAMOS_QUOTA_ACTIVE_MEM_BP:               Active to total LRU memory ratio.
> > >   * @DAMOS_QUOTA_INACTIVE_MEM_BP:     Inactive to total LRU memory ratio.
> > > + * @DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP:        Scheme-eligible memory ratio of a
> > > + *                                   node.
> > > + * @DAMOS_QUOTA_NODE_INELIGIBLE_MEM_BP:      Scheme-ineligible memory ratio of a
> > > + *                                   node.
> > >   * @NR_DAMOS_QUOTA_GOAL_METRICS:     Number of DAMOS quota goal metrics.
> > >   *
> > >   * Metrics equal to larger than @NR_DAMOS_QUOTA_GOAL_METRICS are unsupported.
> > > @@ -206,6 +210,8 @@ enum damos_quota_goal_metric {
> > >       DAMOS_QUOTA_NODE_MEMCG_FREE_BP,
> > >       DAMOS_QUOTA_ACTIVE_MEM_BP,
> > >       DAMOS_QUOTA_INACTIVE_MEM_BP,
> > > +     DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP,
> > > +     DAMOS_QUOTA_NODE_INELIGIBLE_MEM_BP,
> > >       NR_DAMOS_QUOTA_GOAL_METRICS,
> > >  };
> > >
> > > diff --git a/mm/damon/core.c b/mm/damon/core.c
> > > index b9e12865622c..3e0ac65e34a0 100644
> > > --- a/mm/damon/core.c
> > > +++ b/mm/damon/core.c
> > > @@ -17,6 +17,8 @@
> > >  #include <linux/string.h>
> > >  #include <linux/string_choices.h>
> > >
> > > +#include "ops-common.h"
> > > +
> >
> > I don't find a reason to include this, and I'd like to avoid including that in
> > core.c unless it is really necessary.  Could you please remove this?
> >
> 
> The include was added because the implementation uses damon_get_folio() to
> determine NUMA node placement of folios when iterating eligible regions.

Thank you for clarifying, Ravi.

> Would you prefer that I move the damon_get_folio() declaration to
> include/linux/damon.h, or would you suggest a different approach such as
> adding an ops callback for the node calculation?

I'd like to keep it mm/damon/ internal if possible.  Maybe adding new files,
say, mm/damon/common.{c,h} is one option.

Just keeping it as is for now with clarification comment (e.g., "including
ops-common.h for damon_get_folio()") for now, and revisiting for cleanup in
future could also be another option.

I slightly prefer the second option at the moment.

> 
> > Below looks all good for RFC level code to move on to the next stage (dropping
> > RFC tag). :)
> >
> 
> Thank you, SJ! Will send v5 with fixes once I hear back on the above.

Sounds good, looking forward to!


Thanks,
SJ

[...]

  reply	other threads:[~2026-03-23 23:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 19:04 [RFC PATCH v4 0/1] mm/damon: add node_eligible_mem_bp and node_ineligible_mem_bp goal metrics Ravi Jonnalagadda
2026-03-20 19:04 ` [RFC PATCH v4 1/1] " Ravi Jonnalagadda
2026-03-21 16:54   ` SeongJae Park
2026-03-23 19:41     ` Ravi Jonnalagadda
2026-03-23 23:54       ` SeongJae Park [this message]
2026-03-25  2:49   ` kernel test robot
2026-03-21 16:57 ` [RFC PATCH v4 0/1] " SeongJae Park
2026-03-23 19:23   ` Ravi Jonnalagadda
2026-03-23 23:45     ` SeongJae 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=20260323235438.85953-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=ajayjoshi@micron.com \
    --cc=akpm@linux-foundation.org \
    --cc=bijan311@gmail.com \
    --cc=corbet@lwn.net \
    --cc=damon@lists.linux.dev \
    --cc=honggyu.kim@sk.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ravis.opensrc@gmail.com \
    --cc=yunjeong.mun@sk.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 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.