From: SeongJae Park <sj@kernel.org>
To: Gutierrez Asier <gutierrez.asier@huawei-partners.com>
Cc: SeongJae Park <sj@kernel.org>,
artem.kuzin@huawei.com, stepanov.anatoly@huawei.com,
wangkefeng.wang@huawei.com, yanquanmin1@huawei.com,
zuoze1@huawei.com, damon@lists.linux.dev,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH v2 3/4] mm/damon: New module with hot application detection
Date: Wed, 11 Mar 2026 07:32:06 -0700 [thread overview]
Message-ID: <20260311143207.96707-1-sj@kernel.org> (raw)
In-Reply-To: <2895abe3-96f7-4428-8161-a8223ec758b7@huawei-partners.com>
On Wed, 11 Mar 2026 16:45:06 +0300 Gutierrez Asier <gutierrez.asier@huawei-partners.com> wrote:
>
>
> On 3/11/2026 7:11 AM, SeongJae Park wrote:
> > On Tue, 10 Mar 2026 16:24:19 +0000 <gutierrez.asier@huawei-partners.com> wrote:
> >
> >> From: Asier Gutierrez <gutierrez.asier@huawei-partners.com>
> >
> > I'd like to discuss about this in a high level, but I'd like to do that on the
> > cover letter. To this patch, I'm therefore adding comments for only details
> > that stand out immeadiately to me.
>
> I will update the cover letter to add more details for the next version.
>
> >>
> >> 1. It first launches a new kthread called damon_dynamic. This thread
> >> will behave as a supervisor, launching new kdamond threads for all
> >> the processes we want to montiored. The tasks are sorted
> >> by utime delta. For the top N tasks, a new kdamond thread will be
> >> launched.
> >
> > If I read the cover letter and the code of this patch correctly, seems the last
> > two sentences of the above paragraph is outdated. Please correct me if I'm
> > wrong.
>
> Correct, I forgot to delete it.
Thank you for confirming that, and accepting my suggestions below. Most of
your answers to my comments make sense, so I'm cutting most of the part except
places where I want to clarify my points or answer your questions below.
[...]
> >> +};
> >> +DEFINE_DAMON_MODULES_DAMOS_TIME_QUOTA(damon_hugepage_quota);
> >> +
> >> +static struct damos_watermarks damon_hugepage_wmarks = {
> >> + .metric = DAMOS_WMARK_FREE_MEM_RATE,
> >> + .interval = 5000000, /* 5 seconds */
> >> + .high = 900, /* 90 percent */
> >> + .mid = 800, /* 80 percent */
> >> + .low = 50, /* 5 percent */
> >> +};
> >> +DEFINE_DAMON_MODULES_WMARKS_PARAMS(damon_hugepage_wmarks);
> >
> > In the RFC v1 discussion, you also mentioned you will remove the above, but
> > seems it is forgotten?
> >
> > Also, my understadning of your reply on the previous discussion was that you
> > don't really want to use watermarks in this module, and therefore you want to
> > remove it. Am I correct? If I'm not, maybe I'm still not understanding the
> > intention of the watermarks. Can you please enlighten me?
>
> Since I refactored heavily the previous code, I forgot to delete this bit.
> I will remove it now.
Thank you for clarifying this :)
>
> >> +
> >> +static struct damon_attrs damon_hugepage_mon_attrs = {
> >> + .sample_interval = 5000, /* 5 ms */
> >> + .aggr_interval = 100000, /* 100 ms */
> >> + .ops_update_interval = 0,
> >
> > Is ops_update_interval = 0 really your intention?
>
> I didn't think about it. I will set it to 60 seconds, as in other modules.
Sounds good.
When 'vaddr' operation set is used, for every ops_update_interval, 'vaddr'
updates monitoring target regions boundary to cover all virtual address
mappings. If it is '0', it will do the update on every iteration of the
kdamond main loop. It can result in unnecessary overhead. So I was asking the
above question. Setting it to 60 seconds sounds good to me.
[...]
> >> + err = damon_modules_new_ctx_target(¶m_ctx, ¶m_target,
> >> + DAMON_OPS_VADDR);
> >> + if (err)
> >> + return err;
> >
> > You should deallocate param_ctx before returning the error.
>
> Not sure about this. As far as I know, damon_modules_new_paddr_ctx_target
> will destroy the context in case there is an error. In fact, reclaim and
> lru_sort modules just return error when damon_modules_new_paddr_ctx_target
> fails, no cleanup used.
You're correct, I was trying to comment only below, but somehow confused the
place. Sorry for the confusion.
[...]
> >> +
> >> + list_for_each_entry_safe(monitored_task, tmp, monitored_tasks, list) {
> >
> > Please wrap lines for the 80 columns limit.
>
> Interesting, when check it, i was less than 80 columns. Even if I copy this line
> and paste it into any text editor, I still get less than 80 characters.
Oh, you must be correct. Maybe my mailing tool was showing it incorrectly.
Please keep it as is if it doesn't exceed 80 columns.
Thanks,
SJ
[...]
next prev parent reply other threads:[~2026-03-11 14:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 16:24 [RFC PATCH v2 0/4] mm/damon: Support hot application detections gutierrez.asier
2026-03-10 16:24 ` [RFC PATCH v2 1/4] mm/damon: Generic context creation for modules gutierrez.asier
2026-03-11 0:57 ` SeongJae Park
2026-03-11 13:10 ` Gutierrez Asier
2026-03-11 14:15 ` SeongJae Park
2026-03-10 16:24 ` [RFC PATCH v2 2/4] mm/damon: Support for synchrounous huge pages collapse gutierrez.asier
2026-03-11 1:02 ` SeongJae Park
2026-03-11 13:11 ` Gutierrez Asier
2026-03-11 14:17 ` SeongJae Park
2026-03-10 16:24 ` [RFC PATCH v2 3/4] mm/damon: New module with hot application detection gutierrez.asier
2026-03-11 4:11 ` SeongJae Park
2026-03-11 13:45 ` Gutierrez Asier
2026-03-11 14:32 ` SeongJae Park [this message]
2026-03-10 16:24 ` [RFC PATCH v2 4/4] DAMON_HOT_HUGEPAGE documentation gutierrez.asier
2026-03-11 5:07 ` [RFC PATCH v2 0/4] mm/damon: Support hot application detections SeongJae Park
2026-03-11 13:08 ` Gutierrez Asier
2026-03-11 14:39 ` SeongJae Park
2026-03-11 23:55 ` SeongJae Park
2026-03-12 14:42 ` Gutierrez Asier
2026-03-13 0:08 ` 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=20260311143207.96707-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=artem.kuzin@huawei.com \
--cc=damon@lists.linux.dev \
--cc=gutierrez.asier@huawei-partners.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=stepanov.anatoly@huawei.com \
--cc=wangkefeng.wang@huawei.com \
--cc=yanquanmin1@huawei.com \
--cc=zuoze1@huawei.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