From: JaeJoon Jung <rgbi3307@gmail.com>
To: SeongJae Park <sj@kernel.org>
Cc: damon@lists.linux.dev, linux-mm@kvack.org
Subject: Re: [PATCH] mm/damon: modified damon_call_control from static to kmalloc
Date: Tue, 9 Dec 2025 21:20:42 +0900 [thread overview]
Message-ID: <CAHOvCC6_-h1jQkZMbtYDC_jrB490jzp1t1Fx-_mhYnE7tqvzbw@mail.gmail.com> (raw)
In-Reply-To: <20251207023625.44177-1-sj@kernel.org>
Hello, SeongJae,
Thank you for your detailed feedback.
My patch has the advantage of removing the use of
the damon_call_control.dealloc_on_cancel variable.
Other than that, I agree with you pointed out.
It's not a patch that significantly improves functionality,
so I'm fine with doing whatever you decide.
Thanks,
JaeJoon
On Sun, 7 Dec 2025 at 11:36, SeongJae Park <sj@kernel.org> wrote:
>
> On Sun, 7 Dec 2025 07:47:23 +0900 JaeJoon Jung <rgbi3307@gmail.com> wrote:
>
> > The damon_call_control structure is used by all damon modules.
> > In mm/damon/sysfs.c, it is dynamically allocated with kmalloc(),
>
> It is only for refresh_ms handling damon_call_control.
> damon_sysfs_damon_call() doesn't use kmalloc().
>
> > and in
> > the remaining modules, it is statically coded.
>
> I try not to use dynamic allocation when possible and *reasonable*, since doing
> so eliminates the chances of bugs from dynamic allocation handling mistakes.
>
> > There are many daemon
> > modules and they are designed to be used only when needed. It is more
> > efficient to use kmalloc dynamically whenever needed as in damon/sysfs.c.
>
> I agree that is more efficient in terms of kernel size. Nevertheless, I don't
> think it is a significant improvement, since it is only single data structure
> per the DAMON module. The total number of DAMON modules is only five. Two
> among those are samples.
>
> > Using damon_call_control dynamically and consistently has the advantage of
> > eliminating the dealloc_on_cancel member variable condition and reducing
> > code size.
>
> Disadvantage of this change is that it is adding four more dynamic allocations
> that we need to cautiously maintain. It is not significantly increasing the
> maintenance overhead. But, the advantage (kernel size reduction) also seems
> only modest, if I'm not wrong.
>
> So I'm sadly have to say I don't think this change is really needed.
>
> Please let me know if I'm missing something, though.
>
>
> Thanks,
> SJ
>
> [...]
next prev parent reply other threads:[~2025-12-09 12:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-06 22:47 JaeJoon Jung
2025-12-07 2:36 ` SeongJae Park
2025-12-09 12:20 ` JaeJoon Jung [this message]
2025-12-10 2:54 ` SeongJae Park
2025-12-11 3:29 ` JaeJoon Jung
2025-12-11 6:04 ` SeongJae Park
2025-12-11 7:38 ` JaeJoon Jung
2025-12-11 7:54 ` SeongJae Park
2025-12-11 8:13 ` JaeJoon Jung
2025-12-12 3:46 ` SeongJae Park
2025-12-12 7:30 ` JaeJoon Jung
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=CAHOvCC6_-h1jQkZMbtYDC_jrB490jzp1t1Fx-_mhYnE7tqvzbw@mail.gmail.com \
--to=rgbi3307@gmail.com \
--cc=damon@lists.linux.dev \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.org \
/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