From: SeongJae Park <sj@kernel.org>
To: Josh Law <objecting@objecting.org>
Cc: SeongJae Park <sj@kernel.org>,
akpm@linux-foundation.org, damon@lists.linux.dev,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 0/2] mm/damon/core: Performance optimizations for the kdamond hot path
Date: Mon, 23 Mar 2026 07:03:05 -0700 [thread overview]
Message-ID: <20260323140306.79853-1-sj@kernel.org> (raw)
In-Reply-To: <20260322213631.259212-1-objecting@objecting.org>
I show you already posted v3 [1] of this series. So I'm skipping this version.
[1] https://lore.kernel.org/20260322214325.260007-1-objecting@objecting.org
Thanks,
SJ
On Sun, 22 Mar 2026 21:36:29 +0000 Josh Law <objecting@objecting.org> wrote:
> Hello,
>
> This patch series provides two performance optimizations for the DAMON
> core, specifically targeting the hot paths in kdamond.
>
> The first patch optimizes kdamond_apply_schemes() by inverting the loop
> order. By iterating over schemes first and regions second, we can
> evaluate scheme-level invariants (like activation status and quotas)
> once per scheme rather than for every single region. This significantly
> reduces CPU overhead when multiple schemes are present or when quotas
> are reached.
>
> The second patch eliminates a hardware integer division in
> damon_max_nr_accesses() by using the pre-cached aggr_samples value.
> Since this function is called once per region per sampling interval,
> removing the division provides a measurable reduction in CPU cycles
> spent in the access rate update path.
>
> Changes from v1:
> - Use min_t(unsigned long, ...) in damon_max_nr_accesses() to satisfy
> checkpatch warnings and improve readability.
>
> Josh Law (2):
> mm/damon/core: optimize kdamond_apply_schemes() by inverting scheme
> and region loops
> mm/damon/core: eliminate hot-path integer division in
> damon_max_nr_accesses()
>
> include/linux/damon.h | 3 +-
> mm/damon/core.c | 68 ++++++++++++++++++-------------------------
> 2 files changed, 29 insertions(+), 42 deletions(-)
>
> --
> 2.43.0
Sent using hkml (https://github.com/sjp38/hackermail)
prev parent reply other threads:[~2026-03-23 14:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-22 21:36 [PATCH v2 0/2] mm/damon/core: Performance optimizations for the kdamond hot path Josh Law
2026-03-22 21:36 ` [PATCH v2 1/2] mm/damon/core: optimize kdamond_apply_schemes() by inverting scheme and region loops Josh Law
2026-03-22 21:36 ` [PATCH v2 2/2] mm/damon/core: eliminate hot-path integer division in damon_max_nr_accesses() Josh Law
2026-03-23 14:03 ` SeongJae Park [this message]
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=20260323140306.79853-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 \
--cc=objecting@objecting.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.