linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Enze Li <lienze@kylinos.cn>
To: sj@kernel.org, akpm@linux-foundation.org
Cc: damon@lists.linux.dev, linux-mm@kvack.org, enze.li@gmx.com,
	Enze Li <lienze@kylinos.cn>
Subject: [RFC PATCH 0/2] mm/damon: Introduce basic auto-tuning framework with priority support
Date: Tue,  9 Dec 2025 22:50:24 +0800	[thread overview]
Message-ID: <20251209145026.3263754-1-lienze@kylinos.cn> (raw)

Currently, users need to manually tune multiple parameters (e.g.,
watermarks, quotas) for different workloads when using DAMON.  This
increases the barrier to entry and complicates adoption.  This patchset
aims to lower this barrier by introducing a basic auto-tuning
framework for DAMON, which allows the system to automatically adapt
DAMON's operational parameters based on user-provided hints and system
state.

The core idea is to allow users to assign a simple priority level to
each monitoring target.  Based on these priorities and the current system
conditions (initially focusing on free memory), the framework
dynamically adjusts DAMON's parameters.  The initial implementation
focuses on the automatic management of watermarks.

While the auto-tuning functionality could be implemented in user space
as a separate daemon, integrating it directly into the DAMON kernel
subsystem offers distinct advantages essential for a memory management
automation feature.  First, it delivers superior performance and
real-time responsiveness by executing tuning logic within the monitoring
thread (kdamond) context, eliminating the latency and overhead of
frequent kernel-user space context switches and system calls.  This
ensures parameter adjustments can keep pace with DAMON's monitoring
cycles.  Second, it provides inherent reliability as the tuning logic
becomes an integral part of the DAMON context, immune to failures of any
user-space process (e.g., termination by the OOM killer) and requiring
no additional service management.  Finally, it offers a simplified,
out-of-the-box experience where users enable auto-tuning through a
single configuration without needing to install, maintain, or ensure
version compatibility of an external tool.  This kernel-based approach
aligns with the goal of creating a robust, low-overhead, and truly
self-adaptive memory management subsystem.

You may want to verify this framework using the following testing
procedure:

 # git clone -b v2 https://github.com/lienze/damo.git
 # cd damo
 # ./damo start --target_pid $(pidof <target1>) --priority 50 \
 --target_pid $(pidof <target2>) --priority 30 --damos_action \
 pageout

Enze Li (2):
  mm/damon/auto-tuning: introduce DAMON-based auto-tunning module
  mm/damon/sysfs: introduce priority sysfs interface

 include/linux/damon.h  |   3 +
 mm/damon/Kconfig       |  11 ++
 mm/damon/Makefile      |   1 +
 mm/damon/auto-tuning.c | 244 +++++++++++++++++++++++++++++++++++++++++
 mm/damon/auto-tuning.h |  10 ++
 mm/damon/core.c        |  11 ++
 mm/damon/sysfs.c       |  41 +++++++
 7 files changed, 321 insertions(+)
 create mode 100644 mm/damon/auto-tuning.c
 create mode 100644 mm/damon/auto-tuning.h

-- 
2.52.0



             reply	other threads:[~2025-12-09 14:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 14:50 Enze Li [this message]
2025-12-09 14:50 ` [RFC PATCH 1/2] mm/damon/auto-tuning: introduce DAMON-based auto-tunning module Enze Li
2025-12-09 14:50 ` [RFC PATCH 2/2] mm/damon/sysfs: introduce priority sysfs interface Enze Li
2025-12-12  3:38 ` [RFC PATCH 0/2] mm/damon: Introduce basic auto-tuning framework with priority support SeongJae 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=20251209145026.3263754-1-lienze@kylinos.cn \
    --to=lienze@kylinos.cn \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=enze.li@gmx.com \
    --cc=linux-mm@kvack.org \
    --cc=sj@kernel.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