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 1/4] mm/damon: Generic context creation for modules
Date: Wed, 11 Mar 2026 07:15:32 -0700 [thread overview]
Message-ID: <20260311141533.96435-1-sj@kernel.org> (raw)
In-Reply-To: <013c9fcd-bdeb-4508-8495-9ce9cd65b578@huawei-partners.com>
On Wed, 11 Mar 2026 16:10:19 +0300 Gutierrez Asier <gutierrez.asier@huawei-partners.com> wrote:
>
>
> On 3/11/2026 3:57 AM, SeongJae Park wrote:
> > On Tue, 10 Mar 2026 16:24:17 +0000 <gutierrez.asier@huawei-partners.com> wrote:
> >
> >> From: Asier Gutierrez <gutierrez.asier@huawei-partners.com>
> >>
> >> It is more elegant to have a generic version of new context creation
> >> which receives the mode as a parameter.
> >>
> >> Signed-off-by: Asier Gutierrez <gutierrez.asier@huawei-partners.com>
> >> Co-developed-by: Anatoly Stepanov <stepanov.anatoly@huawei.com>
> >> ---
> >> mm/damon/lru_sort.c | 5 +++--
> >> mm/damon/modules-common.c | 6 +++---
> >> mm/damon/modules-common.h | 4 ++--
> >> mm/damon/reclaim.c | 5 +++--
> >> 4 files changed, 11 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c
> >> index 7bc5c0b2aea3..143ee0b21da6 100644
> >> --- a/mm/damon/lru_sort.c
> >> +++ b/mm/damon/lru_sort.c
> >> @@ -287,7 +287,8 @@ static int damon_lru_sort_apply_parameters(void)
> >> unsigned int hot_thres, cold_thres;
> >> int err;
> >>
> >> - err = damon_modules_new_paddr_ctx_target(¶m_ctx, ¶m_target);
> >> + err = damon_modules_new_ctx_target(¶m_ctx, ¶m_target,
> >> + DAMON_OPS_PADDR);
> >
> > I like the name of the function is becoming shorter. But I'm not happy with
> > the fact the resulting calling code becomes longer.
> >
> > I understand you are doing this extension because you want a version of the
> > function for vaddr. What about introducing another dedicated function, say,
> > damon_modules_new_vaddr_ctx_target() ?
> >
> > And you can avoid duplicates between damon_modules_new_{p,v}addr_ctx_target()
> > by implementing internal function, say, damon_modules_new_ctx_target() that
> > receives the damon_ops_id. And damon_modules_new_{P,v}addr_ctx_target() will
> > just wrappers of damon_modules_new_ctx_target().
>
> Sure, I will do it.
Thanks for accepting my suggestion.
>
> Since this is some generic code not related to the module I am working on,
> maybe I can move this to a different patch set that we can upstream. What do
> you think?
Please feel free to do so :)
Thanks,
SJ
[...]
next prev parent reply other threads:[~2026-03-11 14:15 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 [this message]
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
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=20260311141533.96435-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 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.