From: SJ Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SJ Park <sj@kernel.org>,
damon@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH v5 0/2] mm/damon/core: iterate over installed probes instead of DAMON_MAX_PROBES
Date: Mon, 2 Nov 2026 07:37:50 -0800 [thread overview]
Message-ID: <20261102153753.97769-1-sj@kernel.org> (raw)
From: Suhaas Joshi <suhaas@s-joshi.in>
There were two "todo: " items of the same nature in mm/damon/core.c.
Both of these suggested that we should iterate over only installed
probes while updating (last_)probe_hits[] during merging/splitting
regions, instead of iterating over the entire array, which may have
empty/unused indices.
So this patch series does exactly that. It replaces the for-loop over
[0, DAMON_MAX_PROBES) with a damon_for_each_probe() over the probe list
of the context.
Reviewer note.
These patches are based off mm-new. They pass all KUnit tests related to
damon. I have boot tested (but nothing beyond) on qemu-x86_64. Please do
let me know if I should do any specific tests and link the logs here.
The series has been tested with mm-new fetched on Oct 14, 2026.
Changes from v4
- v4: https://lore.kernel.org/20261015135533.18761-1-suhaas@s-joshi.in
- Collect R-b: from SJ.
- Remove/separate messages in cover letter that not suitable for commit
message.
- Wrap cover letter for 75 columns length.
- Rebase to latest mm-new.
Changes v3 -> v4:
1. In some places, kunit_skip() was being called before freeing
resources. This is correctly ordered now.
2. In some places, regions were not being freed. In v4, they are being
freed.
Link to v3: https://lore.kernel.org/damon/20261012145636.168436-1-suhaas@s-joshi.in/T/#t
Changes v2 -> v3:
1. In test functions, new probe and context allocations happen after
target, region etc have been allocated. Further, target is added to
the context. These 2 changes help in reducing allocation code and
improving simplicity and readability of the patches. This change is
true for both patches. (on SJ suggestion)
2. Earlier, if a function's argument list required multiple lines, I was
aligning these lines to the opening paranthesis of the function. In
v3, these begin after 2 tab spaces. (On SJ suggestion)
3. damon_test_last_region_quota_reset() uses the older version of
damos_skip_charged_region(). Make it use the new version.
Link to v2: https://lore.kernel.org/damon/20261008151944.113714-1-suhaas@s-joshi.in/
Changes v1 -> v2:
1. simplified commit message of patch 1 (on Liew's suggestion)
2. wrapped all lines at 80 characters (on SJ's suggestion)
3. added comments for new argument in function (on SJ's suggestion)
4. added damon_ctx_destroy() in r2 failure case in
damon_test_merge_two() (on SJ/Sashiko/Liew suggestion)
Link to v1: https://lore.kernel.org/damon/20261007154851.45368-1-suhaas@s-joshi.in/
SJ Park (1):
mm/damon/core: copy only installed probe in damon_split_region_at()
Suhaas Joshi (1):
mm/damon/core: use only installed probe in damon_merge_two_regions()
mm/damon/core.c | 57 +++++++++++++++----------
mm/damon/tests/core-kunit.h | 84 +++++++++++++++++++++++++++++++------
2 files changed, 106 insertions(+), 35 deletions(-)
base-commit: 79e2e91bd5a4b213cf40819c2711a9364b2c0f86
--
2.47.3
next reply other threads:[~2026-11-02 15:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 15:37 SJ Park [this message]
2026-11-02 15:37 ` [PATCH v5 1/2] mm/damon/core: use only installed probe in damon_merge_two_regions() SJ Park
2026-11-02 15:37 ` [PATCH v5 2/2] mm/damon/core: copy only installed probe in damon_split_region_at() 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=20261102153753.97769-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®