From nobody Sat Jul 25 19:59:43 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 297C8150997; Tue, 14 Jul 2026 04:34:43 +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=1784003684; cv=none; b=K5c0AdztRF1i5VpEjdvrcasDea/FOuQ0HT9vw5ev00NtFS7OegaKyAfWEXv6peEXfHTt4NyYbgszqEhmL19QBOpYc7OXzflZDg3itT9RbKF8qnZCVLPVl71sveDUikTS9/oYhEaY0IBzByEQcTdsocw/EZWB/yOzwFBsl07lp/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784003684; c=relaxed/simple; bh=28KQrfeI2zvjHjr6PuDX7oyWWH3SuTV6OXLAVtISIPA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VT0IELKzSVdEcCCdxe23/4oRRF1Mp+7ntKb7L+YkQshvbJH/+CBM9rBQLiVx7Uhe3YA2o2q92E5WDmOGHCXqCmCbVT65HxTE7TSC2v0vcagoFrqTm4Ghz62wwX6NMsAhFxkWIg4DhDmZpBt4CsDagjJpR9BouOMk+rEj2CpM9Dw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VQRV77Tb; 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="VQRV77Tb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF35F1F00A3A; Tue, 14 Jul 2026 04:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784003682; bh=O1GFuFV6Qv2wWJnuvFbk/HsH8hWm9YYqEFf3m4C5iW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VQRV77TbKCUCH8IIFl5SmwBxcr7DCsc0PHVTjB4QqHoY4fgGMOvJCZa8DI9M7ykYd AGEPwYZeh2oj6uJ+WMGR3dzoJI+taM8N82sUkKnX16BHWrwQ764XFFU89JxM8nrD0n Qa4b2Plfg3QqQbTBj4n1gIxwOqK1Wp563CBJSwNiCnPKFkRS2TCZm/MvncH2lvpb3r lABcSdLR1kWgyT25ZPbRY6oFCHYGBzJs+n/cOcM3hY3LUqfxN7Sbg/YJ0FCOgxYEMU F7dpH1T+W2uEKXxgqOEKK+xMj1wVz+0fP0C6gtbiNKOfGQZVN5yF6aji/nfj9XDyFH DCl2lFWH4fOOA== From: SJ Park To: Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 01/10] mm/damon/core: hide private damon_region fields Date: Mon, 13 Jul 2026 21:34:27 -0700 Message-ID: <20260714043437.95811-2-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714043437.95811-1-sj@kernel.org> References: <20260714043437.95811-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:59:43 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 4AAFF1C6FF5; Tue, 14 Jul 2026 04:34:43 +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=1784003684; cv=none; b=oWHVfYhncstvIGGa20uliPZuFz2gvWtOug+0djjzIAi0dnXp6JMT5nUXfEj580Og9hTvoOExfZrJx86GH6K5rDdjC0mozoIU9ftmDEOlVzmFaWWeqPEWnl+al5tuAkdORiVBie2vvI0tjFGFHdbOgyj37dyqgdltiyAOVbur/yk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784003684; c=relaxed/simple; bh=3PoFXRZE5p8gFw6SuUdvsbrJKOuvciCgPsJD1haajhw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XdFC0Z0+gUK1s6Igq8o2Q33yvRnGDwamD5ldA62sXhN4uwsFHf37Max/d9lZXNITBju53czsLPN4JaJ/ksLvsuuhHsjCu3IJSLw44GRvPJFVfkn1QXs9uZgpfJRzluZpkcTUGiqyl3qJPXwCDv7nrjlX8NKUFvwpnlWZy0ib+gI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nP6v27zd; 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="nP6v27zd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10A951F00A3D; Tue, 14 Jul 2026 04:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784003683; bh=3wUP+A3V/Raa3GTzyt1oBi5Pi6+PUzbHoN/8enGeFJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nP6v27zd4aZIjybbP2COmXtRqP64OzGCediBE5NcFQI8GuA0zz1gNkaynT70/+zZk yM+YIwnMmbkXKyTYLa0jGcOWwSzO6VuBYhrE3QZ/lHkw/w8SkMOme1mrQG4WpPLEEZ Ad4GcPivWRMb3xXEXLWv5ahPmUJEBpH5ttpSp9s/LLZMW5HyqGzYkOcU2/jem0emEC Hm9+poQXtUCUeZkviaPqjtr9ZHdHqc0GFWwu44Qdc9aqZOxpkkvgepa64ezz8nHjsF 4cv8fzPDSCneTLC+RaCJLT9e2tqMg4o3r0+BWRbNsxavDweTgBtn0dYb6ro2E6GufB 8EPNdi2OXrOzA== From: SJ Park To: Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 02/10] mm/damon/core: hide private damon_target fields Date: Mon, 13 Jul 2026 21:34:28 -0700 Message-ID: <20260714043437.95811-3-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714043437.95811-1-sj@kernel.org> References: <20260714043437.95811-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:59:43 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 C34802737F8; Tue, 14 Jul 2026 04:34:43 +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=1784003684; cv=none; b=IZwyoNtotW0IzFT13Z8KD1p8JUB8S8e1GHrB87V3G+gdVVo/wVAq1zWuWbE2iv3qnEayB0eS74VCgjfAVpeyY5VX2KlYZzIpRIvqtpf7H27ZW5fVBpTXm0CQ15TM9OZTvoO/6uqad3Zu/QZQDmMbSMVFS5Y8xMUGCkGyqsHzKO4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784003684; c=relaxed/simple; bh=auZweVBylLMjI8FT8RIyh3Wuk64AJNNXS7HdDEMxPKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rs1m03MXt+DouUJpLt2ZKD9TWzGJ6xdu1oOiS7f71bRHWfDujA/jpQzPaFZX5XWEcOUrVULsrZ07HHqTNBPATGE8RSi3MJJtBBzHJXs6jmpUQGGoIBHG2mgN9A1gbY1ERkrtrWTV56WvJ+UugnQQXr3uryLj6FTFF6sgp+I9KD8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YUYkN1dy; 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="YUYkN1dy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58D2E1F00A3F; Tue, 14 Jul 2026 04:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784003683; bh=0BZxDJkFvulRjFQmRcUYV8xQhtaa1R3auddZnH6jsbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YUYkN1dyAZZVX7GlyawUhpPuUYcxjJtD7mNDEzExlsgDd4Lzuh00cSJ+ITsVT/eQB 6jPW6zrcsJ4xnAnhUlxGkI7jSZDm2eJNk6T8EGMom1fxQMpKMfjFUlbThFWHc+yC2k ybl+0eRpOf/YZhEAcqPsXgjhXqYP1Yk65xjc3ThZElPr1qw8ZoJod2ngN2laAtKNWe GaiX450u37uI+T8dCKsgQjKQ4G1oZAjlFQygK57rOODlYtwlPSTJeOuhVYrDpeViab QsqEzegoO8dlsrEVtXuTO4jsBiDMCdpoh9IZvZImOzpVEe7wrrylv5e83j5BEkHayz VYoy9D59OoWHg== From: SJ Park To: Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 03/10] mm/damon/core: hide private damos_quota_goal fields Date: Mon, 13 Jul 2026 21:34:29 -0700 Message-ID: <20260714043437.95811-4-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714043437.95811-1-sj@kernel.org> References: <20260714043437.95811-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:59:43 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 D8682282F3F; Tue, 14 Jul 2026 04:34:43 +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=1784003685; cv=none; b=hnDWePTbMrG0P57Yq5pE9OP284EIEk4xnAGuth+LNOjgOmL2M7Qbc+wkurJvWEQYRv3bSvva1lwYkA0uQb86RdrfG86tz0MAU2zRqUbw0fmVyzEafTfBUWfN4iZvChX3n3ExgTKkRRWpS00BCwGm+CwMTtDPDH2A5rFT/l1Sfx8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784003685; c=relaxed/simple; bh=0jpvCqL7eB2QWrQVfr7eucpCsgZNYXbbp9++ZbaE9zY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VGw9VjY0f4qERj/mIPYaBWOMIv9WWzBnKt6kSDhiBYXaRPjz6kjH7hodjoYxDSNaP/9cVMd82Jmh1ymD14Ppytwciosa+r1kDWR/jpy8h4tZq7t+BcMcwC3PWcn6+JGqg6/WUPb6Pa6qhnbi70hmqNKLR4mAKOo/K+x5jATbahw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H6rhddFD; 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="H6rhddFD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E1E61F00A3E; Tue, 14 Jul 2026 04:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784003683; bh=t7iohU0bRHpxYfrt1uYJsO4LZsUO4rQ7qDj6JMCliOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=H6rhddFDBSHl5rXZDmtp+PojItc9qKc77bnnk0cj/InyI6o4pze5UI2MghTcB65W7 Et626zfv5Sds66otGHGHRt5PmTkFfJUS5Yr2aRSKHlko/qLJlnI8j2MAW7OwPcBFsd OscnW0Qn61K1JW+fcp8oUOvce76B1W+LS7Q6EDF/q68Bk9fmDzMde4qrYKnmYB0mDz X3SPBBcz5k4vcdIh3c0bog/EVCbAq1YmDQxbGsDAUlqdH67jh7fTQG0JtNkBgSwOgu 4IwBMeTzU6C/cVMisbQJ/XtdVOGZwFrQngNC0/rACP2BD9wel8OljuswH2VOcfrN/D 1PdyFca7MfXiQ== From: SJ Park To: Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 04/10] mm/damon/core: hide private damos_quota fields Date: Mon, 13 Jul 2026 21:34:30 -0700 Message-ID: <20260714043437.95811-5-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714043437.95811-1-sj@kernel.org> References: <20260714043437.95811-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:59:43 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 582042C1586; Tue, 14 Jul 2026 04:34:44 +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=1784003685; cv=none; b=gBVChYLF9UhdfK3hfa3co8IWi+4TijKT5GwVBpNxNqFVDS8Hy9MVuRKI7NEEN2XkA5MQgf8KNIpG8+E6pYEEiCU4s9X5xLLQ4kpk4HG+NERfbVV9pD4EYrLmB081/hn5jYhAbpXQoDaTJld+mWdE3x6P9lOsSZtdFLsPKCmSvkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784003685; c=relaxed/simple; bh=/YooC0Og/qESa3EjUx8EinIYLgt3NHWfzDOzYxdEP/I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aipLe4MVO7i8yTvjMlxh2fxFt+tbSsw/Kzz+oFOGn9TGKhtaiUOrqs2Ee+lweqdHzYT6nASQtozdv9JgKicdZvd+eu6Q2uKskNrAvVPBJn7viom/IX30onv8REhFJI0YCML+EWY/xPqQW/Czqpw6xarQpL/41029tIcZ9wkSXRs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lFw4SMDE; 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="lFw4SMDE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5D5E1F00ACA; Tue, 14 Jul 2026 04:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784003684; bh=K9M+/498pDyKMm1s0mlHFjJL8e/IqqSwdiOP+0fBImU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lFw4SMDEogKyEWuA6QtbGBzeT6n0wFQfRE1ayLXO6ZGS0GMl3ZTITnpyo1+Qy+a02 AxjZi/yZA4CjXGPHBWyqDOFzJQswXUOnaRub7RrW1o2AwaZwQ2AnChiqfr7pQLSa08 DujXVyHhErK/TEZZUkKNAAipDRe/IPBMX3y1gE1z006FfEPJjrzX++vv+gYFyKQdwU +ZLAyxoZQcGxMTnCxdtrVwaM0zkTjUH6S9M9q3iiJ7BHZk+sfmjpCEG0CmmzVPoxTW BqMFY9+w/OmDRLaEMuUQ8nl5PyYsiyWiI+hsl9ouORR4N9dzM+BhyKed1xGyHZVs+Y EoHGhHPbS5WTg== From: SJ Park To: Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 05/10] mm/damon/core: hide private damos_filter fields Date: Mon, 13 Jul 2026 21:34:31 -0700 Message-ID: <20260714043437.95811-6-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714043437.95811-1-sj@kernel.org> References: <20260714043437.95811-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:59:43 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 8E6C52D3EEB; Tue, 14 Jul 2026 04:34:44 +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=1784003686; cv=none; b=EoZeabnGA4b0kfnaGlsismwAWwSGneAJppw8zA5ayfYbMFeWzOjPW+akfGQdaEu78yX+iNbhMzo8nqOYB2iJVo6rBRqcPQIIwPb9J/NbXIZi2v1m7kGid/KrlrksPLdccTsOhwXe1DAMmKMxKjDyzkolSdc3Pohy4PTQNEFx0yQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784003686; c=relaxed/simple; bh=4Wd0tKH5UL4Av18kcbzr9djImdMNZscBF/G9rg4s9JM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b8rVbKV6TswqJ6mz9XT8N4qUmTG+20lYNboWeZWHwsK9yJkCs9VJj1uMxBcx5flaUtUzPokBm+ACQjzUPTEBHxzxzabevIaE8Qd5H3DiDbwFnOkvpf8XssAr6DhHxbzWkiOcl95snsxrNO4d7y4H6aZQgphMukTSMwkJfM3VJiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kaVBoUoC; 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="kaVBoUoC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37DAD1F000E9; Tue, 14 Jul 2026 04:34:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784003684; bh=49szHoBkn5sDldjM9+XsvM62mHHlAwosCDD8pFLfc3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kaVBoUoCqWg+Mqb/X8nZ2sMIr7T/XyFXoWfzFHELqs8PSGQv/gAQHhVgtKu9omyNP tOqK0ABBELOZiDOh0A87I4MGPhQcCJfqiBsazz7OmcDQ/wy8yzyuS+IziZ2RI0Imji LuP/k2lj9mQn63BQ6p+O9CnRvo4ALAEO+Do0bH2vfa3Tes3RzzKm4+UES5yvQO7W93 vBXyN0TlWcAQqvxYfAkQBNVSvdXWYMgI6U/aWxmpWKnXWZ4NOt6HWRff9nAsjk2LBH 7JFBIr7RSpUKSVVGMvl30BNBjgsMtq32d/pWTdx4yigXf6c0gQ8P7tRU+/6LAavKgn IyQkbRNpTNqoQ== From: SJ Park To: Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 06/10] mm/damon/core: hide private damos fields Date: Mon, 13 Jul 2026 21:34:32 -0700 Message-ID: <20260714043437.95811-7-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714043437.95811-1-sj@kernel.org> References: <20260714043437.95811-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:59:43 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 BA5492DCBE3; Tue, 14 Jul 2026 04:34:44 +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=1784003686; cv=none; b=Vytzn94q2qBQr26+qr/yePcWBoMXzQ13ogz2SVmOQXklkmfnX9TSsimPQ+R6mBqFuwBOa2jA2r3HkvRNSMPCFBdxQCgrWI9Sjh1mPpPhE3XlMPtNt7tgOKRxsFE8FSUHxPZ0Z2Nl8idkcXERpD278ndOz4sl79QkUVIJ5eyk5YI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784003686; c=relaxed/simple; bh=IivE0CWKTdcUn47+Hm3ucbbgQtvBEUhe8axmDQs6bPk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W9NtfrlO3aalq2pbsTngB/7D1ouEG1Y1sZRZwDDep5+x665geOLKypxrISrbak+gNbmwgpyaaP11P+7AbpzlCWbT0xARurstEmDQSyut+jAVMqbgYYdHZsWLeV2hM2yczM+ZML9vdjyILHUDYUo8ijoXup+jfxGwx0cNU11RGS8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iRcG+bUq; 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="iRcG+bUq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8133B1F00A3A; Tue, 14 Jul 2026 04:34:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784003684; bh=OgmQTZfSicG2akeujY0x1j+uFMrq86YzkqctonivABI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iRcG+bUqxlShKXkBXEBVh/HqQEiB4R0Smqh5ZqJJu9ZeBTi5TU7fpq6ZUqNRGkZCB cpy19YJ3Nd20RJp6KQ0KcqrwzgeKpbxbSWRo5/MztNkuJcB58M3CKq0ZJm3iPTbeH5 jfKdTJs8LLCYsXRHAnFpYwx7dvTCQBT5mWiauhuXhkJ++XrLU8ZRADyQ7r888K2JJL ctYDqvBf6zYRVi55iP9fpoJJa5Lw2plZIZIUIqCtfRG+e5XOqxu+w/u5jzS25Olch5 ZPS8fZ98xQVM6LzOwYYfTSAUGCDcstA0kkBIhth8Iegu43AEf9XXwMg1h7vxvTnU37 v74H0eBKFSTUA== From: SJ Park To: Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 07/10] mm/damon/core: hide private damon_filter fields Date: Mon, 13 Jul 2026 21:34:33 -0700 Message-ID: <20260714043437.95811-8-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714043437.95811-1-sj@kernel.org> References: <20260714043437.95811-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:59:43 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 3DEF52E739C; Tue, 14 Jul 2026 04:34:45 +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=1784003686; cv=none; b=KBWPgr9r5oax6gNRKo9cC+/uT4/t7BnzANysV/GH2+4ZVxR83ovtIApzevoa+SQZInMFDw00DMCl+tLFJVXLplAEjSriJzGFUSo9GNSUUVlj9VY0E05fi+S3KwhuU7YGYi6yZyLKxGbbkTODIpavGI3fCwj4+nsfieoekgP7KnY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784003686; c=relaxed/simple; bh=IOUFa3Rr5sUKqiSQ4949uWNUB9wvdhUOW3P60EqLuM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ddq7X4UBby7jjy00CQvbncKWJgQ/EcKBMyE7WOHnt31C9ebO/x45ArvNsRScin20UyIkgYHVmdH/RqMwHq8iCeQb9c+ydJOZevMPQ0QXczPetvRspsq9mKjjztZNv2c/Dg5NMb2tbOQEjiuYE7rB8J1TLrHWFgGfN5AtRMdS3co= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=o17T4qOh; 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="o17T4qOh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C88CC1F00A3D; Tue, 14 Jul 2026 04:34:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784003684; bh=VsJ4wwCCUmuJy3/ZXQ2uE1d89EPU2Gxwaw+AywiLsUE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=o17T4qOhIETSz8POalLLjC1zKtxmiS27JkUXNPf8ba0nExsmyGUyAHpfooPZGMjRj RRCOs9tYtBIoYJemdeqsLsuAsQheONHisBDQV+WbKZO6TqmjZU/2kHbY7XwUJ+N+VM 8wblpwJkK5qYJ1rG4qq+SMX1JksMSz43AZ/bbnNcf6Lx8HNFg+pQTT9Js7lMysSuRW +N1zbH+PzTAFj7xi1y+NjCYkG/r2b1oRJTM54fQaAq2iZ5C0e1KpnKK0zgfqpbog2I uAhXpHy7KMQUn5aXMmbgHBcnhNA5X2rIMxCzg6LexDYb+yY/mptiZV0R2hGy7wisBq N2TocSceqTWPw== From: SJ Park To: Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 08/10] mm/damon/core: hide private damon_probe fields Date: Mon, 13 Jul 2026 21:34:34 -0700 Message-ID: <20260714043437.95811-9-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714043437.95811-1-sj@kernel.org> References: <20260714043437.95811-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:59:43 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 656442E8B67; Tue, 14 Jul 2026 04:34:45 +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=1784003686; cv=none; b=SLQKG1KALYz1BiLoKKsOEzFklijwif1mspBePA1DSD3AYn9pynQmy7gTWTnbXzfJoydTLwNyeUE17wNHJqhUz5RUDvDlMZOPmnTdW185KjMk9vLHIiTDkjtFQK8/0z9yJODjaYoj1Nn41j4AdTQj+8V+pkGPM/o1QIoxbBi+FPQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784003686; c=relaxed/simple; bh=dRXX2J+TsX65dbJuv4S6AqbJqGvS7BCYhLBktYK5WKY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s5Wcxp5CicdufOYp812SRhxRYSok+PnbprVG8samCTXNoByef11e7Rp84JPoQUjE0nTs+xRAZRaT/sZNIhbRyjsYMIWAZSJNJoKv4j8Gi7IFPd544K7KcNKe+dJuApsfFpcex6xqd4+fmAIuEvvDBjvq9o10yDXHbOHuKi1l1Js= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mod0YMvx; 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="mod0YMvx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CF2B1F00A3E; Tue, 14 Jul 2026 04:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784003685; bh=UrQWXD0bifnsUsYgqcN+mYTdFMuNVs+95dSBQVBP0NI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mod0YMvxWwnNieAilRhZlXa4fBY4k1B/jJ17n9UWCbmMi8tkIdmEXYbLd0hemF6zl HxM2L6kryfF9ldwH07+K0/KgPRPkPiFUU4xuZSIjEvAdK6Bs5vjTA7Xn8GTtV0jaPr +wJAGhSpxF0iREV3CuCo/s5JHxuGknG0grRFJYdh+PhcuKRCWH1G2c35vfT7cDjGgs 2jl5pUDv6kjRvSOtroA90n4qKz3x1JOGpv/XLQpTaDf8vvvzFR+/ANK7xoSGHWHfJh j7DJ2TUof92FhIrcYDeuWCrxBfjHJ3b2irKbJ1dI384MzRF7eA8pui8BffCThCxpJ9 lLO8+QNGPv66g== From: SJ Park To: Cc: SJ Park , Andrew Morton , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 09/10] mm/damon/sysfs: do not directly access damon_ctx->ops Date: Mon, 13 Jul 2026 21:34:35 -0700 Message-ID: <20260714043437.95811-10-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714043437.95811-1-sj@kernel.org> References: <20260714043437.95811-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:59:43 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 A516F2EDD6B; Tue, 14 Jul 2026 04:34:45 +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=1784003686; cv=none; b=onNbKxHtXNIcNJQ1C02AK9pbKHkT4oxyY5ASdtKZ5YjbkoNGJyB8t1k6KzZcVwUuwEBnp7rCVnSCxAyCqIpS0Hj+bzhvdqIbqTsb0QNn1fZr4RkVwCspXDASGAWnPkt57SdIe2PR5njrx+TKhnF2s5V2kCNFW0WIl0yfD93F3eI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784003686; c=relaxed/simple; bh=UfuQFaQAE52zcf10oVu3LHduiT5JIasy1NGQTVWftkE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GsLRX4jrQhfFcLASe/+GeE6wld6qX8mVxGIokcWc37AnBkHUZh8IQ3xeYBhCnobxEcovJsDGvn0dCmQiQ6axy2KL1m41FZoyjyI2GhNItWwWQVIoH9arYA8K3ZQka2l5PMdZNjMUAj57a65X9NmxWXh1UHHd8m64xA0UYoX1aWs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LkEe8e3U; 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="LkEe8e3U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A87B1F00A3F; Tue, 14 Jul 2026 04:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784003685; bh=Nx5e31jEsyo+C5Jzh5WXWtwiWc9v5lBvS+tYDZCZe5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LkEe8e3UTZtu/dCxbCA9jUo0qcEklu5uKbpCJX1k35d8t0paquV8tRgmoEkqPO1Ma FQCWvJ0ChNjq+V2aoC86L3SFkFxnHaY7gfcFgB+9f/Udy2WkSldao2xE60CSM6bAgh v+sot+OTbqguCtNuaYDQG9EOtx4+Kj4sGmvBDt3l9PvxoC6JKKMPoufbcOPpJY1MAX +8SIikf9AhD2zYpEJPINKqaAARyOD6aapQwUz64A9QQ69MHX/PKhnmEQEV/OwtniN6 XxQKChVCZgdHzw8yTdJIxUVs0jSu5s9NY9V0FfDZj+L0L/0TjTitxX2YXkABMDuBZo uSZnYBORIrBKA== From: SJ Park To: Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 10/10] mm/damon/core: hide core-private damon_ctx fields Date: Mon, 13 Jul 2026 21:34:36 -0700 Message-ID: <20260714043437.95811-11-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260714043437.95811-1-sj@kernel.org> References: <20260714043437.95811-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