From: SJ Park <sj@kernel.org>
To: SJ Park <sj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
damon@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH 0/8] mm/damon: validate all parameters in the core
Date: Sun, 5 Jul 2026 09:46:08 -0700 [thread overview]
Message-ID: <20260705164609.101994-1-sj@kernel.org> (raw)
In-Reply-To: <20260705155600.96555-1-sj@kernel.org>
On Sun, 5 Jul 2026 08:55:51 -0700 SJ Park <sj@kernel.org> wrote:
> DAMON has a number of parameters. Some of the parameters are validated
> by DAMON, while some are validated by DAMON API callers. Each caller
> has their own set of parameters that are exposed to users. Hence each
> caller has their own ways to do the validation. There is no clear lines
> for the responsibilities. It is confusing and easy to make mistakes at
> validations. Actually we found a few bugs in the class.
>
> Define DAMON core as the place to do all the validations and implement
> those. damon_set_regions(), damon_start() and damon_commit_ctx() are
> the three main DAMON core API functions for setup of DAMON parameters.
> Make the three functions to do safe and holistic parameter checks. The
> first one is already providing the validation, so changes are only for
> the last two functions.
>
> This might add unnecessary validations for some use cases. The overhead
> should be negligible as parameters update is expected to only rarely
> happen. It reduces the number of places to check and fix for bugs of
> the class from all callers to the single component. The maintenance
> efficiency gain is obvious.
>
> Further cleanup documents and caller code. Make the lines of validation
> duties clearer. Remove validations that are no more needed owing to the
> core validations.
Sashiko found a few things but those are not real issues in my opinion. Please
read my replies to Sashiko comments on DAMON mailing list thread [1].
DAMON mailing list is opted in to Sashiko finding mail delivery to the author
and the mailing list. I record my opinions to those by replying to the thread.
Hence you can show the detailed opinions from DAMON mailing list thread.
[1] https://lore.kernel.org/damon/20260705155600.96555-1-sj@kernel.org/
Thanks,
SJ
[...]
next prev parent reply other threads:[~2026-07-05 16:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-05 15:55 [PATCH 0/8] mm/damon: validate all parameters in the core SJ Park
2026-07-05 15:55 ` [PATCH 1/8] mm/damon/core: safely validate src on damon_commit_ctx() SJ Park
2026-07-05 15:55 ` [PATCH 2/8] mm/damon/core: do parameter testing commit on damon_start() SJ Park
2026-07-05 15:55 ` [PATCH 3/8] mm/damon/sysfs: remove duplicated commit input validity check SJ Park
2026-07-05 15:55 ` [PATCH 4/8] mm/damon/reclaim: remove duplicated min_region_sz power of 2 check SJ Park
2026-07-05 16:12 ` sashiko-bot
2026-07-05 16:36 ` SJ Park
2026-07-05 15:55 ` [PATCH 5/8] mm/damon/lru_sort: remove duplicated min_region_sz power_of_2() check SJ Park
2026-07-05 15:55 ` [PATCH 6/8] mm/damon: document region size validation in damon_set_regions() SJ Park
2026-07-05 15:55 ` [PATCH 7/8] mm/damon/core: remove start, end check in damon_set_region_system_rams() SJ Park
2026-07-05 16:06 ` sashiko-bot
2026-07-05 16:40 ` SJ Park
2026-07-05 15:55 ` [PATCH 8/8] mm/damon/sysfs: remove region size validation SJ Park
2026-07-05 16:05 ` sashiko-bot
2026-07-05 16:41 ` SJ Park
2026-07-05 16:46 ` SJ Park [this message]
2026-07-05 19:16 ` [PATCH 0/8] mm/damon: validate all parameters in the core Andrew Morton
2026-07-05 19:43 ` 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=20260705164609.101994-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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 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.