mm/damon/core: Performance optimizations for the kdamond hot path
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 5 repliesIn review
- v22 patches 1 replySuperseded
- v12 patches 10 repliesSuperseded
Changes in v3 from the cover letter
- Fix multi-line if statement alignment in the first patch to satisfy checkpatch --strict.
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | mm/damon/core: optimize kdamond_apply_schemes() by inverting scheme and region loopsmm/ | +30 | 1 reply | |
| 2/2 | mm/damon/core: eliminate hot-path integer division in damon_max_nr_accesses()include/ | +1 | 3 replies |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | SeongJae Park |
|---|---|
| 1/2 | |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/2] mm/damon/core: Performance optimizations for the kdamond hot path
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 v2:
- Fix multi-line if statement alignment in the first patch to satisfy checkpatch --strict.
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(-)
Signature · 1 line
2.43.0