DAMON: add priority-based scheme application control
From: | Enze Li <lienze-AT-kylinos.cn> | |
To: | sj-AT-kernel.org, akpm-AT-linux-foundation.org | |
Subject: | [RFC PATCH 0/2] DAMON: add priority-based scheme application control | |
Date: | Mon, 22 Sep 2025 18:10:20 +0800 | |
Message-ID: | <20250922101022.362822-1-lienze@kylinos.cn> | |
Cc: | damon-AT-lists.linux.dev, linux-mm-AT-kvack.org, enze.li-AT-gmx.com, Enze Li <lienze-AT-kylinos.cn> | |
Archive-link: | Article |
This patchset introduces a priority mechanism for DAMON's scheme application, allowing users to specify the relative importance of monitored processes. The changes ensure that higher-priority targets receive more frequent memory management operations while maintaining fairness across all monitored processes. The first patch modifies kdamond_apply_schemes to implement priority-based scheduling, where targets are processed in proportion to their assigned priority values. For example, a target with priority 50 will be serviced 50 times for every 30 times a target with priority 30 is processed. The second patch adds a sysfs interface (priority under each target's directory) to dynamically configure these priorities at runtime. This enables fine-grained control over DAMON's behavior, making it more adaptable to performance-sensitive workloads. Together, these changes provide better flexibility for users who need differentiated memory management policies across different processes while maintaining backward compatibility with existing setups. You may want to verify this feature 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 --damos_age 5s 5s Enze Li (2): mm/damon/core: introduce priority concept for DAMON mm/damon/sysfs: add priority support for DAMOS targets include/linux/damon.h | 2 + mm/damon/core.c | 91 ++++++++++++++++++++++++++++++++++++++++++- mm/damon/sysfs.c | 28 +++++++++++++ 3 files changed, 119 insertions(+), 2 deletions(-) -- 2.51.0