* [PATCH v2 0/5] mm/damon: misc fixups and improvements for 6.18
@ 2025-09-16 3:23 SeongJae Park
2025-09-16 3:23 ` [PATCH v2 1/5] mm/damon/core: reset age if nr_accesses changes between non-zero and zero SeongJae Park
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: SeongJae Park @ 2025-09-16 3:23 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Liam R. Howlett, David Hildenbrand,
Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
Suren Baghdasaryan, Vlastimil Babka, damon, kernel-team,
linux-doc, linux-kernel, linux-mm
Misc fixes and improvements for DAMON that are not critical and
therefore aims to be merged into Linux 6.18-rc1.
The first patch improves DAMON's age counting for nr_accesses zero
to/from non-zero changes.
The second patch fixes an initial DAMOS apply interval delay issue that
is not realistic but still could happen on an odd setup.
The third and the fourth patches update DAMON community meetup
description and DAMON user-space tool example command for DAMOS usage,
respectively.
Finally, the fifth patch updates MAINTAINERS section name for DAMON to
just DAMON.
Changes from v1
(https://lore.kernel.org/20250915015807.101505-1-sj@kernel.org)
- Separate [1] damon_attrs param_ctx usage as a hotfix patch
- Make nr_accesses reset condition easy to read
- Collect Joshua's Reviewed-by tags
Changes from RFC
(https://lore.kernel.org/20250909034353.7064-1-sj@kernel.org)
- The RFC was only for the first patch
- Rebase and wordsmith the first patch
- Add a few misc fixes and improvements for 6.18 to the series
[1] https://lore.kernel.org/20250916031549.115326-1-sj@kernel.org
SeongJae Park (5):
mm/damon/core: reset age if nr_accesses changes between non-zero and
zero
mm/damon/core: set effective quota on first charge window
Docs/mm/damon/maintainer-profile: update community meetup for
reservation requirements
Docs/admin-guide/mm/damon/start: add --target_pid to DAMOS example
command
MAINTAINERS: rename DAMON section
Documentation/admin-guide/mm/damon/start.rst | 2 +-
Documentation/mm/damon/maintainer-profile.rst | 17 ++++++-----------
MAINTAINERS | 2 +-
mm/damon/core.c | 6 +++++-
4 files changed, 13 insertions(+), 14 deletions(-)
base-commit: 4178fb3b4a5145053746caab556b1c5f5538bf3f
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/5] mm/damon/core: reset age if nr_accesses changes between non-zero and zero
2025-09-16 3:23 [PATCH v2 0/5] mm/damon: misc fixups and improvements for 6.18 SeongJae Park
@ 2025-09-16 3:23 ` SeongJae Park
2025-09-16 3:23 ` [PATCH v2 2/5] mm/damon/core: set effective quota on first charge window SeongJae Park
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2025-09-16 3:23 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, damon, kernel-team, linux-kernel, linux-mm, Joshua Hahn
DAMON resets the age of a region if its nr_accesses value has
significantly changed. Specifically, the threshold is calculated as 20%
of largest nr_accesses of the current snapshot. This means that regions
changing the nr_accesses from zero to small non-zero value or from a
small non-zero value to zero will keep the age. Since many users treat
zero nr_accesses regions special, this can be confusing. Kernel code
including DAMOS' regions priority calculation and DAMON_STAT's idle time
calculation also treat zero nr_accesses regions special. Make it
unconfusing by resetting the age when the nr_accesses changes between
zero and a non-zero value.
Signed-off-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
---
mm/damon/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/damon/core.c b/mm/damon/core.c
index be5942435d78..ff2c6bb30621 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -2261,6 +2261,8 @@ static void damon_merge_regions_of(struct damon_target *t, unsigned int thres,
damon_for_each_region_safe(r, next, t) {
if (abs(r->nr_accesses - r->last_nr_accesses) > thres)
r->age = 0;
+ else if ((r->nr_accesses == 0) != (r->last_nr_accesses == 0))
+ r->age = 0;
else
r->age++;
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/5] mm/damon/core: set effective quota on first charge window
2025-09-16 3:23 [PATCH v2 0/5] mm/damon: misc fixups and improvements for 6.18 SeongJae Park
2025-09-16 3:23 ` [PATCH v2 1/5] mm/damon/core: reset age if nr_accesses changes between non-zero and zero SeongJae Park
@ 2025-09-16 3:23 ` SeongJae Park
2025-09-16 3:23 ` [PATCH v2 3/5] Docs/mm/damon/maintainer-profile: update community meetup for reservation requirements SeongJae Park
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2025-09-16 3:23 UTC (permalink / raw)
To: Andrew Morton; +Cc: SeongJae Park, damon, kernel-team, linux-kernel, linux-mm
The effective quota of a scheme is initialized zero, which means there
is no quota. It is set based on user-specified time/quota/quota goals.
But the later value set is done only from the second charge window. As
a result, a scheme having a user-specified quota can work as not having
the quota (unexpectedly fast) for the first charge window. In practical
and common use cases the quota interval is not too long, and the
scheme's target access pattern is restrictive. Hence the issue should
be modest. That said, it is apparently an unintended misbehavior. Fix
the problem by setting esz on the first charge window.
Fixes: 1cd243030059 ("mm/damon/schemes: implement time quota") # 5.16.x
Signed-off-by: SeongJae Park <sj@kernel.org>
---
mm/damon/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/damon/core.c b/mm/damon/core.c
index ff2c6bb30621..775121ae7a9b 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -2142,8 +2142,10 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s)
return;
/* First charge window */
- if (!quota->total_charged_sz && !quota->charged_from)
+ if (!quota->total_charged_sz && !quota->charged_from) {
quota->charged_from = jiffies;
+ damos_set_effective_quota(quota);
+ }
/* New charge window starts */
if (time_after_eq(jiffies, quota->charged_from +
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 3/5] Docs/mm/damon/maintainer-profile: update community meetup for reservation requirements
2025-09-16 3:23 [PATCH v2 0/5] mm/damon: misc fixups and improvements for 6.18 SeongJae Park
2025-09-16 3:23 ` [PATCH v2 1/5] mm/damon/core: reset age if nr_accesses changes between non-zero and zero SeongJae Park
2025-09-16 3:23 ` [PATCH v2 2/5] mm/damon/core: set effective quota on first charge window SeongJae Park
@ 2025-09-16 3:23 ` SeongJae Park
2025-09-16 3:23 ` [PATCH v2 4/5] Docs/admin-guide/mm/damon/start: add --target_pid to DAMOS example command SeongJae Park
2025-09-16 3:23 ` [PATCH v2 5/5] MAINTAINERS: rename DAMON section SeongJae Park
4 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2025-09-16 3:23 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Liam R. Howlett, David Hildenbrand,
Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
Suren Baghdasaryan, Vlastimil Babka, damon, kernel-team,
linux-doc, linux-kernel, linux-mm, Joshua Hahn
DAMON community meetup was having two different kinds of meetups:
reservation required ones and unrequired ones. Now the reservation
unrequested one is gone, but the documentation on the maintainer-profile
is not updated. Update.
Signed-off-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
---
Documentation/mm/damon/maintainer-profile.rst | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/Documentation/mm/damon/maintainer-profile.rst b/Documentation/mm/damon/maintainer-profile.rst
index 5cd07905a193..58a3fb3c5762 100644
--- a/Documentation/mm/damon/maintainer-profile.rst
+++ b/Documentation/mm/damon/maintainer-profile.rst
@@ -89,18 +89,13 @@ the maintainer.
Community meetup
----------------
-DAMON community is maintaining two bi-weekly meetup series for community
-members who prefer synchronous conversations over mails.
+DAMON community has a bi-weekly meetup series for members who prefer
+synchronous conversations over mails. It is for discussions on specific topics
+between a group of members including the maintainer. The maintainer shares the
+available time slots, and attendees should reserve one of those at least 24
+hours before the time slot, by reaching out to the maintainer.
-The first one is for any discussion between every community member. No
-reservation is needed.
-
-The seconds one is for discussions on specific topics between restricted
-members including the maintainer. The maintainer shares the available time
-slots, and attendees should reserve one of those at least 24 hours before the
-time slot, by reaching out to the maintainer.
-
-Schedules and available reservation time slots are available at the Google `doc
+Schedules and reservation status are available at the Google `doc
<https://docs.google.com/document/d/1v43Kcj3ly4CYqmAkMaZzLiM2GEnWfgdGbZAH3mi2vpM/edit?usp=sharing>`_.
There is also a public Google `calendar
<https://calendar.google.com/calendar/u/0?cid=ZDIwOTA4YTMxNjc2MDQ3NTIyMmUzYTM5ZmQyM2U4NDA0ZGIwZjBiYmJlZGQxNDM0MmY4ZTRjOTE0NjdhZDRiY0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t>`_
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 4/5] Docs/admin-guide/mm/damon/start: add --target_pid to DAMOS example command
2025-09-16 3:23 [PATCH v2 0/5] mm/damon: misc fixups and improvements for 6.18 SeongJae Park
` (2 preceding siblings ...)
2025-09-16 3:23 ` [PATCH v2 3/5] Docs/mm/damon/maintainer-profile: update community meetup for reservation requirements SeongJae Park
@ 2025-09-16 3:23 ` SeongJae Park
2025-09-16 3:23 ` [PATCH v2 5/5] MAINTAINERS: rename DAMON section SeongJae Park
4 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2025-09-16 3:23 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Liam R. Howlett, David Hildenbrand,
Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
Suren Baghdasaryan, Vlastimil Babka, damon, kernel-team,
linux-doc, linux-kernel, linux-mm
The example command doesn't work [1] on the latest DAMON user-space
tool, since --damos_action option is updated to receive multiple
arguments, and hence cannot know if the final argument is for deductible
monitoring target or an argument for --damos_action option. Add
--target_pid option to let damo understand it is for target pid.
[1] https://github.com/damonitor/damo/pull/32
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Documentation/admin-guide/mm/damon/start.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/admin-guide/mm/damon/start.rst b/Documentation/admin-guide/mm/damon/start.rst
index ede14b679d02..ec8c34b2d32f 100644
--- a/Documentation/admin-guide/mm/damon/start.rst
+++ b/Documentation/admin-guide/mm/damon/start.rst
@@ -175,4 +175,4 @@ Below command makes every memory region of size >=4K that has not accessed for
$ sudo damo start --damos_access_rate 0 0 --damos_sz_region 4K max \
--damos_age 60s max --damos_action pageout \
- <pid of your workload>
+ --target_pid <pid of your workload>
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 5/5] MAINTAINERS: rename DAMON section
2025-09-16 3:23 [PATCH v2 0/5] mm/damon: misc fixups and improvements for 6.18 SeongJae Park
` (3 preceding siblings ...)
2025-09-16 3:23 ` [PATCH v2 4/5] Docs/admin-guide/mm/damon/start: add --target_pid to DAMOS example command SeongJae Park
@ 2025-09-16 3:23 ` SeongJae Park
4 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2025-09-16 3:23 UTC (permalink / raw)
To: Andrew Morton; +Cc: SeongJae Park, damon, kernel-team, linux-kernel, linux-mm
DAMON section name is 'DATA ACCESS MONITOR', which implies it is only
for data access monitoring. But DAMON is now evolved for not only
access monitoring but also access-aware system operations (DAMOS).
Rename the section to simply DAMON. It might make it difficult to
understand what it does at a glance, but at least not spreading more
confusion. Readers can further refer to the documentation to better
understand what really DAMON does.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
MAINTAINERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 4c8bbf70a3c7..ca8e3d18eedd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6738,7 +6738,7 @@ S: Maintained
W: https://docs.dasharo.com/
F: drivers/platform/x86/dasharo-acpi.c
-DATA ACCESS MONITOR
+DAMON
M: SeongJae Park <sj@kernel.org>
L: damon@lists.linux.dev
L: linux-mm@kvack.org
--
2.39.5
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-09-16 3:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-16 3:23 [PATCH v2 0/5] mm/damon: misc fixups and improvements for 6.18 SeongJae Park
2025-09-16 3:23 ` [PATCH v2 1/5] mm/damon/core: reset age if nr_accesses changes between non-zero and zero SeongJae Park
2025-09-16 3:23 ` [PATCH v2 2/5] mm/damon/core: set effective quota on first charge window SeongJae Park
2025-09-16 3:23 ` [PATCH v2 3/5] Docs/mm/damon/maintainer-profile: update community meetup for reservation requirements SeongJae Park
2025-09-16 3:23 ` [PATCH v2 4/5] Docs/admin-guide/mm/damon/start: add --target_pid to DAMOS example command SeongJae Park
2025-09-16 3:23 ` [PATCH v2 5/5] MAINTAINERS: rename DAMON section SeongJae Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox