Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/damon/sysfs-schemes: support DAMOS_QUOTA_NODE_MEMCG_USED_BP

Add support of DAMOS_QUOTA_NODE_MEMCG_USED_BP. For this, extend quota
goal metric inputs for the new metric, and update DAMOS core layer request
construction logic to set the target cgroup, which is specified by the
user, via the 'path' file.

Link: https://lkml.kernel.org/r/20251017212706.183502-6-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

SeongJae Park and committed by
Andrew Morton
a1d1df78 c41e253a

+14 -1
+14 -1
mm/damon/sysfs-schemes.c
··· 1030 1030 .metric = DAMOS_QUOTA_NODE_MEM_FREE_BP, 1031 1031 .name = "node_mem_free_bp", 1032 1032 }, 1033 + { 1034 + .metric = DAMOS_QUOTA_NODE_MEMCG_USED_BP, 1035 + .name = "node_memcg_used_bp", 1036 + }, 1033 1037 }; 1034 1038 1035 1039 static ssize_t target_metric_show(struct kobject *kobj, ··· 2530 2526 struct damos_quota *quota) 2531 2527 { 2532 2528 struct damos_quota_goal *goal; 2533 - int i; 2529 + int i, err; 2534 2530 2535 2531 for (i = 0; i < sysfs_goals->nr; i++) { 2536 2532 struct damos_sysfs_quota_goal *sysfs_goal = ··· 2549 2545 break; 2550 2546 case DAMOS_QUOTA_NODE_MEM_USED_BP: 2551 2547 case DAMOS_QUOTA_NODE_MEM_FREE_BP: 2548 + goal->nid = sysfs_goal->nid; 2549 + break; 2550 + case DAMOS_QUOTA_NODE_MEMCG_USED_BP: 2551 + err = damon_sysfs_memcg_path_to_id( 2552 + sysfs_goal->path, &goal->memcg_id); 2553 + if (err) { 2554 + damos_destroy_quota_goal(goal); 2555 + return err; 2556 + } 2552 2557 goal->nid = sysfs_goal->nid; 2553 2558 break; 2554 2559 default: