lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240520143038.189061-4-tome01@ajou.ac.kr>
Date: Mon, 20 May 2024 14:30:38 +0000
From: Jonghyeon Kim <tome01@...u.ac.kr>
To: SeongJae Park <sj@...nel.org>,
	damon@...ts.linux.dev,
	linux-mm@...ck.org
Cc: Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org,
	Jonghyeon Kim <tome01@...u.ac.kr>
Subject: [RFC PATCH v2 3/3] mm/damon: add NUMA-awareness to DAMON modules

Using the 'target_nid' parameter of DAMOS watermark, both DAMON_RECLAIM and
DAMON_LRU_SORT modules can set the monitoring range to a specific NUMA
memory node.

Signed-off-by: Jonghyeon Kim <tome01@...u.ac.kr>
---
 mm/damon/lru_sort.c | 13 +++++++++++++
 mm/damon/reclaim.c  | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c
index 3e25a52de..ed136ccba 100644
--- a/mm/damon/lru_sort.c
+++ b/mm/damon/lru_sort.c
@@ -238,6 +238,19 @@ static int damon_lru_sort_apply_parameters(void)
 	damon_set_schemes(ctx, &hot_scheme, 1);
 	damon_add_scheme(ctx, cold_scheme);
 
+	/* Set monitoring range from target node */
+	if (hot_scheme->wmarks.metric == DAMOS_WMARK_NODE_FREE_MEM_RATE) {
+		int target_nid = hot_scheme->wmarks.target_nid;
+
+		if (target_nid == NUMA_NO_NODE)
+			return -EINVAL;
+		monitor_region_start = PFN_PHYS(node_start_pfn(target_nid));
+		monitor_region_end = PFN_PHYS(node_start_pfn(target_nid) +
+				node_present_pages(target_nid) - 1);
+		if (monitor_region_end < monitor_region_start)
+			return -EINVAL;
+	}
+
 	return damon_set_region_biggest_system_ram_default(target,
 					&monitor_region_start,
 					&monitor_region_end);
diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
index 31b8830a8..9c0c0096b 100644
--- a/mm/damon/reclaim.c
+++ b/mm/damon/reclaim.c
@@ -192,6 +192,19 @@ static int damon_reclaim_apply_parameters(void)
 	}
 	damon_set_schemes(ctx, &scheme, 1);
 
+	/* Set monitoring range from target node */
+	if (scheme->wmarks.metric == DAMOS_WMARK_NODE_FREE_MEM_RATE) {
+		int target_nid = scheme->wmarks.target_nid;
+
+		if (target_nid == NUMA_NO_NODE)
+			return -EINVAL;
+		monitor_region_start = PFN_PHYS(node_start_pfn(target_nid));
+		monitor_region_end = PFN_PHYS(node_start_pfn(target_nid) +
+					node_present_pages(target_nid) - 1);
+		if (monitor_region_end < monitor_region_start)
+			return -EINVAL;
+	}
+
 	return damon_set_region_biggest_system_ram_default(target,
 					&monitor_region_start,
 					&monitor_region_end);
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ