linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] mm/damon/sysfs: Add commands useful for using migration dests
@ 2025-08-05 16:20 Bijan Tabatabai
  2025-08-05 16:20 ` [PATCH 1/5] mm/damon/core: Add damos_destroy_dests() Bijan Tabatabai
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Bijan Tabatabai @ 2025-08-05 16:20 UTC (permalink / raw)
  To: damon, linux-mm, linux-kernel, linux-doc
  Cc: sj, Andrew Morton, corbet, Bijan Tabatabai

From: Bijan Tabatabai <bijantabatab@micron.com>

This patchset adds two DAMON commands, commit_schemes_dests and
wait_for_schemes_apply, that I have found useful for using a migrate_hot
scheme with migration dests.

The commit_schemes_dests command, similar to the existing
commit_schemes_quota_goals, is used to commit only the dests fields of
schemes. This has a couple of benefits:
1) It is more efficient than recommitting all the DAMON data.
2) Doing a full commit resets the aggregation and ops_update intervals. If
a user sends the full commit command frequently (relatively to those
intervals) the aggregation and ops_update events will be prevented from
triggering. Having a separate commit command side steps this problem.

The wait_for_schemes_apply command causes the calling thread to wait until
all schemes have been applied. It does this by calling damos_walk() with a
NULL walk_fn. This can be useful, for example, if a user wants to know when
new scheme parameters they've committed have been applied. Another use case
could be if a user wants to record the system state every time a scheme is
applied for debuging purposes.

The functionality of wait_for_schemes_apply can be achieved with the
existing update_schemes_tried_bytes and update_schemes_tried_regions
commands. However, having a separate command avoids extra work and makes
user intent clearer when used in scripts.

The first two patches implement the commit_schemes_dests command.
The third patch implements the wait_for_schemes_apply command.
The fourth and fifth patches add documentation for these new commands.

Bijan Tabatabai (5):
  mm/damon/core: Add damos_destroy_dests()
  mm/damon/sysfs: Implement a command to only commit scheme dests
  mm/damon/sysfs: Implement a command to wait until schemes are applied
  Docs/ABI/damon: Document new DAMON commands
  Docs/admin-guide/mm/damon/usage: Document new DAMON commands

 .../ABI/testing/sysfs-kernel-mm-damon         | 21 ++++----
 Documentation/admin-guide/mm/damon/usage.rst  |  4 ++
 include/linux/damon.h                         |  2 +
 mm/damon/core.c                               | 12 +++--
 mm/damon/sysfs-common.h                       |  3 ++
 mm/damon/sysfs-schemes.c                      | 35 ++++++++++--
 mm/damon/sysfs.c                              | 54 +++++++++++++++++++
 7 files changed, 116 insertions(+), 15 deletions(-)

-- 
2.43.5



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-08-11 16:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-05 16:20 [PATCH 0/5] mm/damon/sysfs: Add commands useful for using migration dests Bijan Tabatabai
2025-08-05 16:20 ` [PATCH 1/5] mm/damon/core: Add damos_destroy_dests() Bijan Tabatabai
2025-08-05 16:20 ` [PATCH 2/5] mm/damon/sysfs: Implement a command to only commit scheme dests Bijan Tabatabai
2025-08-11  7:00   ` Dan Carpenter
2025-08-11 16:35     ` SeongJae Park
2025-08-05 16:20 ` [PATCH 3/5] mm/damon/sysfs: Implement a command to wait until schemes are applied Bijan Tabatabai
2025-08-05 16:20 ` [PATCH 4/5] Docs/ABI/damon: Document new DAMON commands Bijan Tabatabai
2025-08-05 16:20 ` [PATCH 5/5] Docs/admin-guide/mm/damon/usage: " Bijan Tabatabai
2025-08-06  0:40 ` [PATCH 0/5] mm/damon/sysfs: Add commands useful for using migration dests SeongJae Park
2025-08-06  1:27   ` Bijan Tabatabai
2025-08-06  4:15     ` SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).