From nobody Sat Jul 25 19:28:29 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9356D371873; Tue, 14 Jul 2026 14:35:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039756; cv=none; b=f6pos+ghQDnebUpWZEl6+U5mMTWWcD2TGzu1WdTriOsYZ9KY48BizRzPO1cVULkrcTU8DaclDjb73mIDcz/EFdQvp0gWmPNcjTBzW1iQTAOrSqrdT99Bi7TWAv87k2vb7g4gROAU+S0nGLWSr5MVjZrKvul4pYNpdo4ag3Y92z0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039756; c=relaxed/simple; bh=28KQrfeI2zvjHjr6PuDX7oyWWH3SuTV6OXLAVtISIPA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mTPEuTOkovBpZWqHuWIRDp6uymNPgEj08H416H2vd5a/tj4Il7WgMu2qWGBKvUMJTpTUI1kJEJNQCreikFljzqbRr97DjK21RTzfsGZt9U0RuB+di1/zB3d6VIBgS16Y/3MFnHgQLYy0RHQuPJgWSBjbOBwl2OHYZvbjSGxs9sQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Vj/BABRE; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Vj/BABRE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54BED1F00A3D; Tue, 14 Jul 2026 14:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039755; bh=O1GFuFV6Qv2wWJnuvFbk/HsH8hWm9YYqEFf3m4C5iW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Vj/BABREgxJ45Eq0THUdsbJ+Y7Nr2s7nVxZfZ0/tGYE5O3c3SFkc13S+4+AXyGOXA F6c526SxtCDgkpMIEzF4+HaJjj0BcKk9uTdvv8KHyyj0MuQrRxdXYMoyaZqSdjdJz4 CLyaH/cFiv3Xzrhystp9gfOWOws/xKcwTdFhpU81euVo8ngs8He4oWgVG+YT7m1/Y+ 3bzdDfMcIDCiYBLRWVvISdgI2bfyA/YNBGqGixvP4HFrGvbXTHQR9J2rV9E9K9aw4N ZHvI1kBF8tq1Y+WccD0ToAXESh3XkODL0RyDgDM6k9/AU4KWRg6icJNjQXOEgp9joK oZ9aQGRo3masw== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 01/10] mm/damon/core: hide private damon_region fields Date: Tue, 14 Jul 2026 07:35:34 -0700 Message-ID: <20260714143544.101305-2-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714143544.101305-1-sj@kernel.org> References: <20260714143544.101305-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" damon_region->list is intended to be used by only the DAMON core layer. But it is mistakenly not marked as private. Hide it from the callers by marking it private. Signed-off-by: SJ Park --- include/linux/damon.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index f69442a9d4312..d32377e7e535e 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -46,7 +46,6 @@ struct damon_size_range { * @sampling_addr: Address of the sample for the next access check. * @nr_accesses: Access frequency of this region. * @probe_hits: Number of probe-positive region samples. - * @list: List head for siblings. * @age: Age of this region. * * For any use case, @ar should be non-zero positive size. damon_set_regi= ons() @@ -68,9 +67,11 @@ struct damon_region { unsigned long sampling_addr; unsigned int nr_accesses; unsigned char probe_hits[DAMON_MAX_PROBES]; - struct list_head list; unsigned int age; -/* private: Internal value for age calculation. */ +/* private: internal use only. */ + /* List head for siblings. */ + struct list_head list; + /* for age calculation. */ unsigned int last_nr_accesses; unsigned char last_probe_hits[DAMON_MAX_PROBES]; }; --=20 2.47.3 From nobody Sat Jul 25 19:28:29 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E070A370D65; Tue, 14 Jul 2026 14:35:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039757; cv=none; b=LFjBHqJnMlQWhHj9Hb6a8dhTmeWQQO7KqBFSSEsIEVxtoiuY2bRM8YyoVxdgyQJrA9qTo1A9LJ9HYI92HkzxwMInzJEyYDzTf8zJfm5cjr+KeAvm9CacpCrMCPuEv3er1PxZMtmFQJjPf1BnsGfvHabJQdNdkKnga/5kl2T3oFQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039757; c=relaxed/simple; bh=3PoFXRZE5p8gFw6SuUdvsbrJKOuvciCgPsJD1haajhw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FSmJVZT/D6EaaueZyQhMuRN9CJRRXwJ5zhc1L1JM9wApE/wyxg+3GQ7mKxYMXmXcYI+U5IpydU3yG1VvoE8nr6y7VdZD/zhvEbU7idq4Hjn7Oox2OS1jFPQvZbaKAvy7Wr27vngLdcqbBHbGlGQJfY2qC/okPFFtKwjrY55+o+I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l5Rf4pxg; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l5Rf4pxg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FE371F00A3A; Tue, 14 Jul 2026 14:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039755; bh=3wUP+A3V/Raa3GTzyt1oBi5Pi6+PUzbHoN/8enGeFJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l5Rf4pxgD2IqkG6wezOZ27v3qi0J9YlVZMPXvUIKQStRrG5i7Ol79FfGQs0PXllkX /U99kUO56V7z4iF+6RPR2hIpPnyweTw83kEMrmiSLpt7sB5S+eqdP2nd+304yU0q+o OitdBloS4IHWRFIADoI5NOjjy7Pw673U6KdrrBEdw57NbyU/aUxpGCIUuid9A0qQcL kjlUbWkJMLuS1Nfp+t5gl4JWk7ii301Bq7ALbhPhKiA8aFswJC59sodNe1q4ocBXym G++xPcuYIA/7bm4aAe17CIv9tofBE0RqnzPu7hzss9VKis0N36mM99aM7pfTVwmHMR Zk3Hfz1nz2bkA== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 02/10] mm/damon/core: hide private damon_target fields Date: Tue, 14 Jul 2026 07:35:35 -0700 Message-ID: <20260714143544.101305-3-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714143544.101305-1-sj@kernel.org> References: <20260714143544.101305-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'nr_regions', 'regions_list' and 'list' fields of damon_target are intended to be used by only the DAMON core layer. Those are mistakenly not marked as private. Mark as private. Signed-off-by: SJ Park --- include/linux/damon.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index d32377e7e535e..6e160557a0014 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -79,9 +79,6 @@ struct damon_region { /** * struct damon_target - Represents a monitoring target. * @pid: The PID of the virtual address space to monitor. - * @nr_regions: Number of monitoring target regions of this target. - * @regions_list: Head of the monitoring target regions of this target. - * @list: List head for siblings. * @obsolete: Whether the commit destination target is obsolete. * * Each monitoring context could have multiple targets. For example, a co= ntext @@ -95,10 +92,14 @@ struct damon_region { */ struct damon_target { struct pid *pid; + bool obsolete; +/* private: */ + /* Number of monitoring target regions of this target. */ unsigned int nr_regions; + /* Head of the monitoring target regions of this target. */ struct list_head regions_list; + /* List head for siblings. */ struct list_head list; - bool obsolete; }; =20 /** --=20 2.47.3 From nobody Sat Jul 25 19:28:29 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7737A3E3175; Tue, 14 Jul 2026 14:35:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039757; cv=none; b=uZHB71Livz2GDeeeYt6tdSyWRmdPNego7XRIutCQvu65EYlUaEiNVZB1uPlnJOYFJahYvPBvPhwqvIJgmusIWjzl1TitJcAlMdC1Ka69c1UNRftWuhPeIB757YaLlz+GnoSCv1nfCE0pPyMBcIl7/MfmAjUcsQ89EK1tlZwUUg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039757; c=relaxed/simple; bh=auZweVBylLMjI8FT8RIyh3Wuk64AJNNXS7HdDEMxPKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TE7wxeFjyVfk8CpJrfpfH34gJzrUaTkrKiOoHzp9BjKtSxEeKestrbYkCfwZvRBbz6PLHHWfDF89gcD4IpZJAF91Ekrw73xUac0KswddG+8yA261Vr8corA8hwfwsGV/U5kx/4CG22aOLjxvAhkBjuFFp0ArmOMrQ7uRevIMjNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZcUt+/VJ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZcUt+/VJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED2B61F00A3F; Tue, 14 Jul 2026 14:35:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039756; bh=0BZxDJkFvulRjFQmRcUYV8xQhtaa1R3auddZnH6jsbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZcUt+/VJ6EFj791Y85ZWUIaN/TtFMaBjSqNrKxGBZ2RFMCvoXiFbqPTSQx/zBXGfP FPQXGyGYFEYIcNEIKIX0f/Vu8XzUZl6mBdUcLkv0hw8ykxH4ISTxBEP/1Hbl0nm8uw BKJM0EfS9z+7MHCanvB0Eo+cyrgbcPXzbLvuSCdAGpxxBhjgfK6hyDeCWUrG3TlVH1 mPlvfa1qSvJyM6VpFxs4+4c3/KR8aHtEdhYEfHk8VMQfSEC5RU75tIHxIwEMmi6utG yJxZ/qpKznAJccN/t/SprI3hpJLXH92yAv+6jDdkbVRzGjDx1oN3Bz71ch4Ug9BEiI A7KDvRIE6fU2w== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 03/10] mm/damon/core: hide private damos_quota_goal fields Date: Tue, 14 Jul 2026 07:35:36 -0700 Message-ID: <20260714143544.101305-4-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714143544.101305-1-sj@kernel.org> References: <20260714143544.101305-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'last_psi_total' and 'list' of damos_quota_goal are intended to be used by only the DAMON core layer. Those are mistakenly not marked as private, though. Mark as private. Signed-off-by: SJ Park --- include/linux/damon.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 6e160557a0014..d838cc27ee72a 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -175,10 +175,8 @@ enum damos_quota_goal_metric { * @metric: Metric to be used for representing the goal. * @target_value: Target value of @metric to achieve with the tuning. * @current_value: Current value of @metric. - * @last_psi_total: Last measured total PSI * @nid: Node id. * @memcg_id: Memcg id. - * @list: List head for siblings. * * Data structure for getting the current score of the quota tuning goal. = The * score is calculated by how close @current_value and @target_value are. = Then @@ -201,12 +199,17 @@ struct damos_quota_goal { unsigned long current_value; /* metric-dependent fields */ union { - u64 last_psi_total; struct { int nid; u64 memcg_id; }; +/* private: */ + /* Last measured total PSI */ + u64 last_psi_total; + }; +/* private: */ + /* List head for siblings. */ struct list_head list; }; =20 --=20 2.47.3 From nobody Sat Jul 25 19:28:29 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F17843B4BA; Tue, 14 Jul 2026 14:35:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039757; cv=none; b=emfqMLGsMCffN8P2YUZ3RmTVKWO3q8kkNU329LcC9EiEhVOxFSmlqt36NAaSA/fZj6rH9gBfa+ZXKCdApe94oi6Lyk36OqpjADqqEz1OUoAytOGfYGwrK1hqI8LXeQEf8gRTLUuw1qpbs59Q11IZBLVjI9ilx7P9hYmcutFJdIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039757; c=relaxed/simple; bh=0jpvCqL7eB2QWrQVfr7eucpCsgZNYXbbp9++ZbaE9zY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nCtFZjumN2e4pwKKQ8M6oUaE0X4O7UZ9oCjZIckw85Lrf/TwXfnLeXcY/tJqtwJ4uP5f4g59BsyJ3P2zGEEacC3EVE1KFRinCrLqjN1Mi0lseSXvSJayZEmNyrHIhvHMCNNq02x3XKlOQMhh3eQA2oL+eLs0JYdb+qN0WcCG7BM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oWhCyoH6; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oWhCyoH6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48DD71F00A3E; Tue, 14 Jul 2026 14:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039756; bh=t7iohU0bRHpxYfrt1uYJsO4LZsUO4rQ7qDj6JMCliOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oWhCyoH6UI55zYnJIRuLEij7M04dcUeXAABRdD0vCF7uiCusH6dL9i7ChxBDBSgNq tjUdicBOB3BwQJDtM9zxykiTxceWYm7/MUf4vOEGSLOw7b5NBP0UZrEPgvWNNleXvb SYXFa3o2FYDdmWeYWDjOIplUISDotw2sdhF323/YKkuXEXA6X5rq2I6QPTcpTM0m7A 7bMwgO2xJSW9Zv6Xsv+H5L7vxmEx9yVVgMoK7mttoPBe/nzjkHBnnYKZfJR7BiTxJ8 FfQGEkkMbiaYEVSReQuLSKYuSS70q2At3qNKA2Cif0HVSlmTIBuid2F2yrFTspqn4P k9VLUFpi5cvdA== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 04/10] mm/damon/core: hide private damos_quota fields Date: Tue, 14 Jul 2026 07:35:37 -0700 Message-ID: <20260714143544.101305-5-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714143544.101305-1-sj@kernel.org> References: <20260714143544.101305-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" damos_quota->goals is intended to be used by only the DAMON core layer. But it is mistakenly not marked as private. Mark as private. Signed-off-by: SJ Park --- include/linux/damon.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index d838cc27ee72a..bd024b89adfa3 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -228,7 +228,6 @@ enum damos_quota_goal_tuner { * @reset_interval: Charge reset interval in milliseconds. * @ms: Maximum milliseconds that the scheme can use. * @sz: Maximum bytes of memory that the action can be applied. - * @goals: Head of quota tuning goals (&damos_quota_goal) list. * @goal_tuner: Goal-based @esz tuning algorithm to use. * @esz: Effective size quota in bytes. * @fail_charge_num: Failed regions charge rate numerator. @@ -255,7 +254,7 @@ enum damos_quota_goal_tuner { * the scheme's action. DAMON then compares it against &sz and uses small= er * one as the effective quota. * - * If @goals is not empty, DAMON calculates yet another size quota based o= n the + * If goals is not empty, DAMON calculates yet another size quota based on= the * goals using its internal feedback loop algorithm, for every @reset_inte= rval. * Then, if the new size quota is smaller than the effective quota, it use= s the * new size quota as the effective quota. @@ -276,7 +275,7 @@ struct damos_quota { unsigned long reset_interval; unsigned long ms; unsigned long sz; - struct list_head goals; + enum damos_quota_goal_tuner goal_tuner; unsigned long esz; =20 @@ -288,6 +287,8 @@ struct damos_quota { unsigned int weight_age; =20 /* private: */ + /* Head of quota tuning goals (&damos_quota_goal) list. */ + struct list_head goals; /* For throughput estimation */ unsigned long total_charged_sz; unsigned long total_charged_ns; --=20 2.47.3 From nobody Sat Jul 25 19:28:29 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5BDC4446E0; Tue, 14 Jul 2026 14:35:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039757; cv=none; b=fVxtu3h4JfRXOhNjFjJXHeLiX1t/uL1a1pbu/HtXkGuL9D7WWlPshbzyUBABJA5X1I77WaiFfv0Dr2E2Dx2PF30b9+Y9q2XHrh1aO2XC2L8fFGeyb/lUv/ToKqaiGQAfL9tPJjyalfolAHiOUOqE3BnkF3mHllPqSc7wrgdNxwI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039757; c=relaxed/simple; bh=/YooC0Og/qESa3EjUx8EinIYLgt3NHWfzDOzYxdEP/I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LwghkgjaSVI/24RXLraxg6x/yWwLqZbdaw6cbwJdnZfGwGE1w/VDtI01gRxtiacPutomVeyhQHVC2/iqfHmxJnh0RnWOfn1ecio4naUxCfVTyeJ/rZ/PyEKaUfiOJFRpQ4ryIcDmcYQPKwrqYb73TLsG3LEp1UBYEgXZ4b91eyk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WnjEMvgF; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WnjEMvgF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 957F31F000E9; Tue, 14 Jul 2026 14:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039756; bh=K9M+/498pDyKMm1s0mlHFjJL8e/IqqSwdiOP+0fBImU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WnjEMvgFAHBy/bzZQA4a7f1Y36g5vw4oxOI3sJN/eEZTgH4K8axXPJnwr649a+LFa DlbXW0ZCc5W06Wuksp76J+nGs2n6y+gQu/2x4rV1S7JZ6R/f6HSbjDk9gX6yA0nF0r 7sKafT7Og+gChSqB8vcM9rj4dWncysS+TXLjhs6thBw+wkPC4z5yvvVZuzo+V00S2s n6xx3u1qr7rFe1ou6nF8dohhyKs3foNBHilrfNSyZ5T490c695QCroKE/uvZU+DR3E c8cSOlxmtTQO+9fli2Ju/xndl0khBw+w5HQBbbZRt28kn3+uTBzow6denRKj88hF6q MQEKH2adAzeQQ== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 05/10] mm/damon/core: hide private damos_filter fields Date: Tue, 14 Jul 2026 07:35:38 -0700 Message-ID: <20260714143544.101305-6-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714143544.101305-1-sj@kernel.org> References: <20260714143544.101305-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" damos_filter->list is intended to be used by only the DAMON core layer. However, it is mistakenly not marked as private. Mark as private. Signed-off-by: SJ Park --- include/linux/damon.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index bd024b89adfa3..15517be3e4960 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -432,7 +432,6 @@ enum damos_filter_type { * &damon_ctx->adaptive_targets if @type is * DAMOS_FILTER_TYPE_TARGET. * @sz_range: Size range if @type is DAMOS_FILTER_TYPE_HUGEPAGE_SIZE. - * @list: List head for siblings. * * Before applying the &damos->action to a memory region, DAMOS checks if = each * byte of the region matches to this given condition and avoid applying t= he @@ -450,6 +449,8 @@ struct damos_filter { int target_idx; struct damon_size_range sz_range; }; +/* private: */ + /* List head for siblings. */ struct list_head list; }; =20 --=20 2.47.3 From nobody Sat Jul 25 19:28:29 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51C40478849; Tue, 14 Jul 2026 14:35:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039758; cv=none; b=R5SLccQmaN/mpmFtAiV+US4cDz4yxEbiGOSLCSBl0aTAtCLgdJnsT8k86E7uRcGqZQ95lFFl0DHo9PQ7kCEmtXI/KiQpRdkFPmhhS+c54RcWC4IRHkLfqyOpZ/1XX/Pmj2ZxcEXcxc9rxGqjSDSceOZO4dRvTFbPCUN8rG7uUs0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039758; c=relaxed/simple; bh=4Wd0tKH5UL4Av18kcbzr9djImdMNZscBF/G9rg4s9JM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S6wTuEczMfYnmIuLcNhKCHe8AXTZhxFddg9TRj2X7ydrxKq/y2iahnvKbTZxGfH9juZGWUxJXE1VRx7hs5rH0DvkBBikotURJxb4tdnVOOIAy+bjgExPwFcMxKtqBy9ILu4ADt1Jt3cq45aWG0iweCI+AkrSpmQbGuoqiTkdBHo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mNnaRYCq; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mNnaRYCq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1B231F00AC4; Tue, 14 Jul 2026 14:35:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039757; bh=49szHoBkn5sDldjM9+XsvM62mHHlAwosCDD8pFLfc3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mNnaRYCqgE7U6lYS6bSyjxtSvuEsadv2VVJrnzE/7TgdSJqK9gyBH4xG4QwU9BtPl LKCkZV63bfPOyus0+zAJUK9r9sw2nXU51BNTc78xYRBcRw5ji7ZEFa8ffR+BYdIyFy D7RzIfzTazgbFqoXZJ7XyGPNMLNxqohTged/0I02O2VJF20MoiQeMN23cMDi+ysb92 BZoKUMId8sOAqF/vpzXp2T6fgtrnY+OVRpIj1qVSn4mYFb6ShghfOgPTbXgsVhvn/T qzbanAbEvoELUGPXyTEz+p8PwO2gOrxO6LfAHUuDc270TYEwi4T8Z7Le91/K5bYgDo kB55s/e5ErRFQ== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 06/10] mm/damon/core: hide private damos fields Date: Tue, 14 Jul 2026 07:35:39 -0700 Message-ID: <20260714143544.101305-7-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714143544.101305-1-sj@kernel.org> References: <20260714143544.101305-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'core_filters', 'ops_filters', 'last_applied' and 'list' fields of damos are intended to be used by only the DAMON core layer. However, those are mistakenly not marked as private. Mark as private. Signed-off-by: SJ Park --- include/linux/damon.h | 52 ++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 15517be3e4960..907d65f03d083 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -522,12 +522,8 @@ struct damos_migrate_dests { * @wmarks: Watermarks for automated (in)activation of this scheme. * @migrate_dests: Destination nodes if @action is "migrate_{hot,cold}". * @target_nid: Destination node if @action is "migrate_{hot,cold}". - * @core_filters: Additional set of &struct damos_filter for &action. - * @ops_filters: ops layer handling &struct damos_filter objects list. - * @last_applied: Last @action applied ops-managing entity. * @stat: Statistics of this scheme. * @max_nr_snapshots: Upper limit of nr_snapshots stat. - * @list: List head for siblings. * * For each @apply_interval_us, DAMON finds regions which fit in the * &pattern and applies &action to those. To avoid consuming too much @@ -549,16 +545,7 @@ struct damos_migrate_dests { * * Before applying the &action to a memory region, &struct damon_operations * implementation could check pages of the region and skip &action to resp= ect - * &core_filters - * - * The minimum entity that @action can be applied depends on the underlying - * &struct damon_operations. Since it may not be aligned with the core la= yer - * abstract, namely &struct damon_region, &struct damon_operations could a= pply - * @action to same entity multiple times. Large folios that underlying on - * multiple &struct damon region objects could be such examples. The &str= uct - * damon_operations can use @last_applied to avoid that. DAMOS core logic - * unsets @last_applied when each regions walking for applying the scheme = is - * finished. + * &struct damos_filter. * * After applying the &action to each region, &stat is updated. * @@ -569,6 +556,16 @@ struct damos { struct damos_access_pattern pattern; enum damos_action action; unsigned long apply_interval_us; + struct damos_quota quota; + struct damos_watermarks wmarks; + union { + struct { + int target_nid; + struct damos_migrate_dests migrate_dests; + }; + }; + struct damos_stat stat; + unsigned long max_nr_snapshots; /* private: internal use only */ /* * number of sample intervals that should be passed before applying @@ -585,20 +582,25 @@ struct damos { /* whether to reject core/ops filters umatched regions */ bool core_filters_default_reject; bool ops_filters_default_reject; -/* public: */ - struct damos_quota quota; - struct damos_watermarks wmarks; - union { - struct { - int target_nid; - struct damos_migrate_dests migrate_dests; - }; - }; + /* Additional set of &struct damos_filter for &action. */ struct list_head core_filters; + /* ops layer handling &struct damos_filter objects list. */ struct list_head ops_filters; + /* + * Last @action applied ops-managing entity. + * + * The minimum entity that @action can be applied depends on the + * underlying &struct damon_operations. Since it may not be aligned + * with the core layer abstract, namely &struct damon_region, &struct + * damon_operations could apply @action to same entity multiple times. + * Large folios that underlying on multiple &struct damon region + * objects could be such examples. The &struct damon_operations can + * use @last_applied to avoid that. DAMOS core logic unsets + * @last_applied when each regions walking for applying the scheme is + * finished. + */ void *last_applied; - struct damos_stat stat; - unsigned long max_nr_snapshots; + /* List head for siblings. */ struct list_head list; }; =20 --=20 2.47.3 From nobody Sat Jul 25 19:28:29 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EC2647CC6A; Tue, 14 Jul 2026 14:35:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039758; cv=none; b=KZeFYplk7p4BN8CWWAYqB2zLMk/HKGuSS6d1iCEyl+HIqnU5cCbkh5YKS4Xh7ORqMP/cA0IHqWR7m4aBauPakLUvUwI18td1nxXU0gk3IuAw4BmC/Gqt5jmjIBeBHOqetq9sTWvGZTrs5WS/kl40LF1cN87hITZZ8HzXrqT1WKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039758; c=relaxed/simple; bh=IivE0CWKTdcUn47+Hm3ucbbgQtvBEUhe8axmDQs6bPk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i3LsKVvmYXP0hoBNsRWe8lc2XfOC+fOhQmKnG0KLXqAplVvgx6DncVyLwAkArRmNWnHV85V6MpGbGKthvh0PQoG0GBaCKNsfD0qQWU3rDHgW6fAZGdZ+KuU6Hm2WJPzExEm71HGmiof3asaXGvhFDwoC4tgPWQ/fJD6lBQSBEIs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gVRY1QaL; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gVRY1QaL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D6B01F00A3D; Tue, 14 Jul 2026 14:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039757; bh=OgmQTZfSicG2akeujY0x1j+uFMrq86YzkqctonivABI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gVRY1QaLUrnENVs/P6aecaAsLZJDki8N5Y9dQKHfDc9nig/jiF76Q0r58NFLrmaj/ ihSLl7NALNFXfpeSQSwl37bMGd9kSgnNCzoU8F/SBs9UEe4G3Mt+ZPD5g9gWvlYL7c lamxCU932bBFGApJ7w7+54iPHXXFC61uIvb7ofYIr7u1EqRa9DpRoFrcKNJDLqwJCM GNw2B1QrN8hmwOyszVwrZ6GGu6VaDtDJmon56hPOztKv9QMEDE5Yq1YeMnALd4Rw2A 2Cm2KNj63xEM9B3qt0VW/KzYvmxreAoLhjc/2OJ6sAuuMmRpsetl+DjkDIfJERn+J3 Ah6AaN9gQUJ9A== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 07/10] mm/damon/core: hide private damon_filter fields Date: Tue, 14 Jul 2026 07:35:40 -0700 Message-ID: <20260714143544.101305-8-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714143544.101305-1-sj@kernel.org> References: <20260714143544.101305-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" damon_filter->list is intended to be used by only the DAMON core layer. However, it is mistakenly not marked as private. Mark as private. Signed-off-by: SJ Park --- include/linux/damon.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 907d65f03d083..6c3c7c75b6ca3 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -758,7 +758,6 @@ enum damon_filter_type { * @matching: Whether this filter is for the type-matching ones. * @allow: Whether the @type-@matching ones should pass this filter. * @memcg_id: Memcg id of the question if @type is DAMON_FILTER_MEMCG. - * @list: Siblings list. */ struct damon_filter { enum damon_filter_type type; @@ -767,6 +766,8 @@ struct damon_filter { union { u64 memcg_id; }; +/* private: */ + /* Siblings list. */ struct list_head list; }; =20 --=20 2.47.3 From nobody Sat Jul 25 19:28:29 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC17D47DD50; Tue, 14 Jul 2026 14:35:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039759; cv=none; b=BvdnXlwQ3HPVB2DbbRuE0gcQdqW1WbgWYSaR9YVh+xIqEcAWvtQOFFr2Ef4hR0dwR6oSnv8w9pmXE0adqf3PLACIjFBu6a+DmsMqAo6KTOCtxW2IHDozoxutCVPXCRCgrbV9nKzRzNpZrrOYmp3bdCiLxnhyj7AxxtXeyPueVqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039759; c=relaxed/simple; bh=IOUFa3Rr5sUKqiSQ4949uWNUB9wvdhUOW3P60EqLuM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MlpdGfEJVj8MORgA15Q3m+uXkSIlSfHxUCBZekAcW2B3dkpuj+p9aSeUEQuUCcQDU4NDD5BEiU3/zwYKMuDHNl5tIYu4WdbQRWlrfucoR3kHlSyOZJ+wUh27nuqKdY/41zbYe8LC80hpiCLXSRz65giPw43QHXzSeHqLbyls1CQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BHVsmuS9; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BHVsmuS9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B7291F00A3A; Tue, 14 Jul 2026 14:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039757; bh=VsJ4wwCCUmuJy3/ZXQ2uE1d89EPU2Gxwaw+AywiLsUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BHVsmuS9moeWjE4tXVfnnYQuqO+Hokd4h4sU2eeIZX7PWSuvAPLdNNEfqMIw7orJK RQ+CUztOvWnC0IL13lSQaGTmdo4FIqueuiE0pcva7klegfFkWM+Vh9BZWMJ+24CikT iNoTjKGfEFWXgfQBE0W0YOIj7WaUdTgAJfyfkIVbb3pU7xfVq+ezJrSnVVyKjToFYE 8gOzsB1ZwPaDrsHc8XHxT6yYf0icrdmAEeN0C7CJYA93YjCrD4bxQ8ZS9617AGKbvl UojG2hXrMdm9XKw/GGql/hO32oCCRZzTjdP11hxMnpFGuo4N6/sBE1PosYjWHfJkqg Ic2egsfroHcTg== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 08/10] mm/damon/core: hide private damon_probe fields Date: Tue, 14 Jul 2026 07:35:41 -0700 Message-ID: <20260714143544.101305-9-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714143544.101305-1-sj@kernel.org> References: <20260714143544.101305-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'filters' and 'list' fields of damon_probe are intended to be used by only the DAMON core layer. However, those are mistakenly not marked as private. Mark as private. Signed-off-by: SJ Park --- include/linux/damon.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 6c3c7c75b6ca3..537e59bfd7072 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -775,12 +775,13 @@ struct damon_filter { * struct damon_probe - Data region attribute probe. * * @weight: Relative priority of the attribute for this probe. - * @filters: Filters for assessing if a given region is for this probe. - * @list: Siblings list. */ struct damon_probe { unsigned int weight; +/* private: */ + /* Filters for assessing if a given region is for this probe. */ struct list_head filters; + /* Siblings list. */ struct list_head list; }; =20 --=20 2.47.3 From nobody Sat Jul 25 19:28:29 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21ADB47DF85; Tue, 14 Jul 2026 14:35:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039759; cv=none; b=iJtYICyB7w2UibynqZD5GKu63vUUS69Ewykfa8qcEcHaBDn3o+jIoRN4YLStIRfrlqgZvZaVxqXnHBnLb9sXkmGe66q9WW85fL09v2XQvWeA6KTBuMTsKZq3t11zs88CoUYa+0/pgfpWWLPjCSRrzzhVlD/MgG3g0t+5FLob6DI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039759; c=relaxed/simple; bh=dRXX2J+TsX65dbJuv4S6AqbJqGvS7BCYhLBktYK5WKY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=upCOqmNXUlIRE+2nuDIsk2zBH721T5vk4nbd8eXqpuuCq+/rjNMNjQcn6OFXnONG4VvSXrVDhoUyx3mGeHHZ3QfDVggO6F9V9B3fXS99HgAoIl2bEJiHY/YkbMocEozssV9sXPwH/KtFawHj5XtUA9yzutObDA1V3jJtegKJemI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kPizrGqx; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kPizrGqx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7B1E1F00A3E; Tue, 14 Jul 2026 14:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039758; bh=UrQWXD0bifnsUsYgqcN+mYTdFMuNVs+95dSBQVBP0NI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kPizrGqxSPrlQ0S99osZ0phDKd36Guwa0fDDzPkVnkKOq5VFh9VVdj3eS2argD0oy +HDpzY5VSllxbPjICaKzm4WWEzlTu5/QxfV0QG1hnCWCFWHyoadn76/HbrC5s2/I9D Ad6sZD4r9FKuklLhwdufn+NrESCE8OIIoqVjedHYsqR9kZQ7spqdA6Ursp7acIK6Ng BCz7tgC1cC8eWw/16pFxoRjs3FaEb7OlRxbS6xhH5j+b984ShtOdYUaX3sbY3eAdbj ECAV6F/sA2d0PDRDH1fR//7+2qCm9gZIOgfkZCe9vZxbX16nrGuXIVqigkjoSzVmOg caL2SuWnLe3UA== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 09/10] mm/damon/sysfs: do not directly access damon_ctx->ops Date: Tue, 14 Jul 2026 07:35:42 -0700 Message-ID: <20260714143544.101305-10-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714143544.101305-1-sj@kernel.org> References: <20260714143544.101305-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" damon_ctx->ops field is intended to be used by only the DAMON core layer. DAMON_SYSFS is directly reading the field to find if it is for physical address monitoring, though. Use the API function for the purpose, damon_target_has_pid(), instead. Signed-off-by: SJ Park --- mm/damon/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index 60a1a9e4ada34..228ceb4df5f97 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -2051,7 +2051,7 @@ static int damon_sysfs_add_targets(struct damon_ctx *= ctx, int i, err; =20 /* Multiple physical address space monitoring targets makes no sense */ - if (ctx->ops.id =3D=3D DAMON_OPS_PADDR && sysfs_targets->nr > 1) + if (!damon_target_has_pid(ctx) && sysfs_targets->nr > 1) return -EINVAL; =20 for (i =3D 0; i < sysfs_targets->nr; i++) { --=20 2.47.3 From nobody Sat Jul 25 19:28:29 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4BCB47ECD3; Tue, 14 Jul 2026 14:35:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039759; cv=none; b=kdT7aMWrfo0uq/v70w7Pxy3/NclTLmmu863fpcP1MOjj1Ff0A6tkBiGVjXJxJqcZGk+KiwJeWKYI3CuY9ByXFVsFQ68hvuf5oegb/uuZriXn9+bjLx02y/AxGmE7ogFHDMIfrj6Ata4DTmoDwk68ifDhz7Vh5sw0jTVNgWbZWjk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039759; c=relaxed/simple; bh=UfuQFaQAE52zcf10oVu3LHduiT5JIasy1NGQTVWftkE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r/A/I/fJxD865KNl4ika0dmvAajYlBIXIAOHKbJ/1X5QN6yLfbbcI/fP+6g3W2wxtb9py5byl4VBvADJLnD/GMdgAUREyVzMpWAlaC5G/QRP5MTb6uW5P9nhhhcwIg2zsMaBdENwpesmHYOR00p5qcUkgrLUZmsXGewickSSVqg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=X2Rciwt8; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="X2Rciwt8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 314151F000E9; Tue, 14 Jul 2026 14:35:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784039758; bh=Nx5e31jEsyo+C5Jzh5WXWtwiWc9v5lBvS+tYDZCZe5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=X2Rciwt8/MTshxbMH0LSsW0OR5pxu4vbJGl88cl2PRUro+DUfPRKEYh7Vts9El31w X8TbZ54j1otU/V0hjiojVpRFfLpBdszW/YtCED1ora5wJIx0lxLqL6Ow4CxGQO20ii Mg6CyV3lXbGzoHAtXfHrB7lfOF5QnBFUR2EzQdWm8ibl7qgdvMRcayZiM42ol8lb62 7WGvox44qnx8rpsLk0YKFfM9TlYfXSd5ZJrZA/D3cgcMwkpTfLBYx3eR1FOKXxOmWr Uv5+KueXbDIJ7Hlf4Fc5vreeym9sZajj3btVddDyt3mBHllF50x6qphpx/fDSexBOf Lui7jPMAJhntg== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 10/10] mm/damon/core: hide core-private damon_ctx fields Date: Tue, 14 Jul 2026 07:35:43 -0700 Message-ID: <20260714143544.101305-11-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714143544.101305-1-sj@kernel.org> References: <20260714143544.101305-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 'ops', 'probes', 'adaptive_targets', 'schemes', and 'rnd_state' fields of damon_ctx are intended to be used by only the DAMON core layer. However, those are mistakenly not marked as private. Mark as private. Signed-off-by: SJ Park --- include/linux/damon.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 537e59bfd7072..327f534696aa8 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -848,14 +848,9 @@ struct damon_attrs { * thread other than the kdamond should be made using safe DAMON APIs, * including damon_call() and damos_walk(). * - * @ops: Set of monitoring operations for given use cases. - * @probes: Head of probes (&damon_probe) list. * @addr_unit: Scale factor for core to ops address conversion. * @min_region_sz: Minimum region size. * @pause: Pause kdamond main loop. - * @adaptive_targets: Head of monitoring targets (&damon_target) list. - * @schemes: Head of schemes (&damos) list. - * @rnd_state: Per-ctx PRNG state for damon_rand(). */ struct damon_ctx { struct damon_attrs attrs; @@ -904,15 +899,21 @@ struct damon_ctx { struct mutex kdamond_lock; =20 /* public: */ - struct damon_operations ops; - struct list_head probes; unsigned long addr_unit; unsigned long min_region_sz; bool pause; =20 +/* private: */ + /* Set of monitoring operations for given use cases. */ + struct damon_operations ops; + /* Head of monitoring targets (&damon_target) list. */ struct list_head adaptive_targets; + /* Head of probes (&damon_probe) list. */ + struct list_head probes; + /* Head of schemes (&damos) list. */ struct list_head schemes; =20 + /* @rnd_state: Per-ctx PRNG state for damon_rand(). */ struct rnd_state rnd_state; }; =20 --=20 2.47.3