From nobody Fri Sep 25 02:08:28 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 CF63233BBC5; Thu, 17 Sep 2026 04:05: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=1789617947; cv=none; b=rDkMgK5ZEpKYX4Hak7d7Iq/WL28Di6eiIaflUVdzN2c6BbE1wvforch2CrI81yVtr1cjClnqipKqJs4GPeleoh0WIEnFnaFhgJjbfVn1AP+wdeKJS6SfrkHizQD5n5kOycsZb/XQUiOj+e4k/RYNHKfi2ieBfubs7f6mbEUev1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789617947; c=relaxed/simple; bh=5x3DivB9gQB5lxNvwTlsjIfeudSnzImQeh4vtHJ1uLw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dM4iA4g0wpAltf7Y5hKJiVbm1tepAo82IAk0X62Be4LqGiwD07AY01BucmGSisAIcUFg2q6AOgesmIYoZoVCh/QYrPeA7MBd15hAMYZ8I/dgnsYQhz3D9AqvwP7Vnj5kv5aknhv7MZmjD7IuVUrnEYIRT7GiDplWHbmiUNPkgFw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JTN26iIo; 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="JTN26iIo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90ADC1F00898; Thu, 17 Sep 2026 04:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789617945; bh=T7NGmBAgLNyxB6QRiSTsc0KXNRJO/iSY1w2o1E3csW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JTN26iIoHZhelS1NeIJaA/1L6mykFHnMmouYpjQ7s2E2tM4Hdp5ad7L46DnZbdfUH S7bSCftBfMXaJzhFRf/w9OMZSaMWJlZcliIKIiRBngJhOyJRgL4QSj2+rzrHK17gNh qpCC2hkhGferGcj7KF7/FHsVJZmFThTEbywk2ItarAheMjiEYIyWXrmg7fnhJNJYrO 6IpAhYsnBhGUFBkZjxtkDHoIuJ5P6klF7lkwSe7f5lElKaLsZbinzse/4wftbalHqP VhvOXd86KOikIksTTR8J0ZyKNT/F6RjLMHVs5y3IM8HtSSsFMJhFcUHRCHfR7LFx2k eixXf+TisSNGA== From: SJ Park To: Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH v2 01/10] mm/damon/api: remove NR_DAMOS_FILTER_TYPES Date: Wed, 16 Sep 2026 21:05:27 -0700 Message-ID: <20260917040537.107341-2-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260917040537.107341-1-sj@kernel.org> References: <20260917040537.107341-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" Nobody uses NR_DAMOS_FILTER_TYPES. Remove it. Signed-off-by: SJ Park --- include/linux/damon.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index bbb190b474015..836353c4ab9aa 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -400,7 +400,6 @@ struct damos_stat { * @DAMOS_FILTER_TYPE_ADDR: Address range. * @DAMOS_FILTER_TYPE_TARGET: Data Access Monitoring target. * @DAMOS_FILTER_TYPE_PROBE_HITS_WSUM: probe_hits weighted sum range. - * @NR_DAMOS_FILTER_TYPES: Number of filter types. * * All types except &DAMOS_FILTER_TYPE_ADDR, &DAMOS_FILTER_TYPE_TARGET and * &DAMOS_FILTER_TYPE_PROBE_HITS_WSUM are handled by the underlying &struct @@ -422,7 +421,6 @@ enum damos_filter_type { DAMOS_FILTER_TYPE_ADDR, DAMOS_FILTER_TYPE_TARGET, DAMOS_FILTER_TYPE_PROBE_HITS_WSUM, - NR_DAMOS_FILTER_TYPES, }; =20 /** --=20 2.47.3 From nobody Fri Sep 25 02:08:28 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 27DA5376BC2; Thu, 17 Sep 2026 04:05:46 +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=1789617947; cv=none; b=NA1Z1a4Gcqb0nGpBo9VxSifaosNWuTxHIDzy/FAS4kMVzjXCdUTxoQejrUmS+lbw44vk/+Ym7oZZ2WuH5/kUfMe5NU8CexI3PyjsacDcncpPZsJMKo3r6YGVBNReJNEzoq2TxUXeT0OfGloQ4W/khHO77DNIlb6dfE6ZKqdSHtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789617947; c=relaxed/simple; bh=Wko9Artoa0Z5PAQBQ/kk99efp8RqAhI6M/MZlshPmic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B2YZ/s2iDCuuHgRpzZz1nWAxx+tz5rkx/6MGTt7V5xjc0dSHEpkfQ/k65SiC2pjvsr6TI+cNiVjEXbhA2LXhn5+qqz7Hn+38/Mg7TYfwI2eVtIW5EaA6VNZQTiOa3nVlblNeRLN8gIUN7qRBpaJ45vb0HYbJLYAuXfZdpN6T/i0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bzPeRIQd; 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="bzPeRIQd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5B1C1F00893; Thu, 17 Sep 2026 04:05:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789617946; bh=D/xjDMKN2pxjPkDC8M/3Bvu7Q4EfB+XzLNhUIOrk264=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bzPeRIQdTet6vIjgw0TKaEd2PPKGqbVO5HgR63j0IO7vOgaQXJa6IxhOxtbiLjDaE 6d6fQ9V3myXQoQoiJsHWu/5etl4Ba5hN+tpswOdW8ohcByTXqED0efj8dyhQ+oXMdy xChf8X+iYGadx5n+n88RDJJtGzIJnba/SDBzO5ttVtJp3FgkBKmqM9i0xizLBHKbWE TlmJbeq2qX5n4ejwrwbGCFaoj6i1owKeiJCj1abJrdIG9sz3tabgh1SSYDH7AIzORE cVW1cvyReVlDYASbq3G76ZRtohlqtnqXuXPD84gcvC++F6uEm7nsrvdjIvVvLjtos1 4iN3tKer6CB+A== 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 v2 02/10] mm/damon/core: use abs_diff() in damon_feed_loop_next_input() Date: Wed, 16 Sep 2026 21:05:28 -0700 Message-ID: <20260917040537.107341-3-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260917040537.107341-1-sj@kernel.org> References: <20260917040537.107341-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_feed_loop_next_input() is open-coding absolute diff calculation instead of the dedicated helper, abs_diff(), for no good reason. Use the dedicated helper. Signed-off-by: SJ Park --- mm/damon/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index 707fdc82de3a5..0299729e79ed9 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2927,10 +2927,7 @@ static unsigned long damon_feed_loop_next_input(unsi= gned long last_input, if (score >=3D goal * 2) return min_input; =20 - if (over_achieving) - score_goal_diff =3D score - goal; - else - score_goal_diff =3D goal - score; + score_goal_diff =3D abs_diff(score, goal); =20 if (last_input < ULONG_MAX / score_goal_diff) compensation =3D last_input * score_goal_diff / goal; --=20 2.47.3 From nobody Fri Sep 25 02:08:28 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 8694E3812DB; Thu, 17 Sep 2026 04:05:46 +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=1789617947; cv=none; b=H/BZ6nZfqhONssm7PxpEnWbD1KpH+sRvmjs3lhMNX/0QLsVLcuBtP6Jp6y1TNAElLfpKzA1LRziwmgyDr8cE35E+rgcHbXKMmYx28t116pnc9zweLNBTmql0+yPyR2uKa+99XbJVMa9CNbdiSutnOLQXIOxiBsMWXH3LodyqimQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789617947; c=relaxed/simple; bh=5HJTnDNhiF64IPu/ybSD7Z1IbDO0pZhnSblqS6GJ/0k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Njy8jsYR3q5kOo4Y9esYhcDKMULJD5Xb64oK2VDMJhiGedamcQIcnBXCgCaI4qc07qIzbgX9kY+xbNxNOZB8iFSJwCnP5xf0Q4AUkd/ikAlENaDJzJ2ZFNRPe85JaPEGqyxmLI+3jgUK8O9T/p5Mq3HdmEJB5QDZrVFptfwH5oE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eV54DsBz; 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="eV54DsBz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F9C91F00899; Thu, 17 Sep 2026 04:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789617946; bh=t4wob7RRQ/fb9yIvPkmCYITSEq7R5wOfYsN9M2cgFSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eV54DsBzc5z8y7fr/46oE/Wnq1D8InCVloq5Z/hxf5F7EqYunqzmqPJJD80u1swlv 11TJGJrgnsZvPSDp3rPVU0ExhAWklD17ZypmXAOTHWVzN2W0LuwlJvHkgBVuPggPWH VOrh8gqtv7cuI+WcqlHsUN+7y7uMVOJ8z+u3rYwzr/+gEXeZRhqj1q0n+4RvUuHU8C 4WqzwAf3D1jDEs7vWRR823CBv9pCMOTichPSMSGktRPTjsw1pyZX6f7H1TcCwc/DtD qyhU9vZlgqrwdIp6S4wUaUB1h8XTG8Q9qmH7fjm7nJQ6BJcWZu4TtdA00icDlNs/sk LRey78S7YZ1eQ== 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 v2 03/10] mm/damon/core: use mult_frac() in damon_feed_loop_next_input() Date: Wed, 16 Sep 2026 21:05:29 -0700 Message-ID: <20260917040537.107341-4-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260917040537.107341-1-sj@kernel.org> References: <20260917040537.107341-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_feed_loop_next_input() does its best effort overflow protection. score_goal_diff is always smaller than goal (10,000). Hence the calculation can be replaced to use mult_frac() without concerning the overflow. Use mult_frac(). Signed-off-by: SJ Park --- mm/damon/core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index 0299729e79ed9..7bbbd44379301 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2928,11 +2928,7 @@ static unsigned long damon_feed_loop_next_input(unsi= gned long last_input, return min_input; =20 score_goal_diff =3D abs_diff(score, goal); - - if (last_input < ULONG_MAX / score_goal_diff) - compensation =3D last_input * score_goal_diff / goal; - else - compensation =3D last_input / goal * score_goal_diff; + compensation =3D mult_frac(last_input, score_goal_diff, goal); =20 if (over_achieving) return max(last_input - compensation, min_input); --=20 2.47.3 From nobody Fri Sep 25 02:08:28 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 C2C6D377ED9; Thu, 17 Sep 2026 04:05:46 +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=1789617948; cv=none; b=GXYWR05Hd8rCmiDfnznA4sSvSmPkFDQlwbqyRT5nB1bKPxVHr4SQA3XlS/T0y5btubtYQuhrwxo823/C+DYk/VeYOAmUVPHA+VxyvqhVilVYjC8+kSj8kGp78WseQ5VkigM31laOpi5vQACLAbouDFFCChH2UnqbPpqhN+JMr7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789617948; c=relaxed/simple; bh=IEt5isfidqyU0pz+Ed5oabTsHpojfScQRA9L+2gb7C0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q1nUDX5dpXdXWRQE8Rt5BrzXhh6WM1vr8GDxlDjRrnBpMqe4Jr38iT6BjCnjPhPKdJR0aEeWXg9CKaZC44whncOOstgqLwpnuJo+ROJKYuUO96RBYPF0cBsNr1wwgVuWh24FL0l2TBwGpIn605biTI6Mc84jYt/ZW2zfw34ofCM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iNZUqJgP; 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="iNZUqJgP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B3831F0089B; Thu, 17 Sep 2026 04:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789617946; bh=xuBve8B9TeEtlHU83DYclAih0SjxWd5x7DEHnP/pWkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iNZUqJgPOYgDNx/fChezmCGs2a+uNvx1Ni6wOwUmuP5HWXUOzOo3pFR/zhl3me4A2 w8ifdGvr9eE7gjyPh9Hl3tCJ03IUQ8YG72a9xSDvcfYUzbdq2Nxe3/Ekn9JjWrPii7 HHC3XJXFzy+EZ30TA5EyQx31wPManYFvk8t/O0sjhVamfESL+/VOAAs+yeuFur5ROe 4G7M5v1Qq07QAUJXBnH1BlR054B1AqPC0xf6Jy6i7hlvH7zPE8LRcBIBjGWr/IG/aC MenqKNxe7TuRrfJnln6h0Jx3u05NIZsfnnnLQ1/f4C9V8FNCwNLhqMdo5Xje6kEq1x d7TzwqrwDsueQ== 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 v2 04/10] mm/damon/core: set damon_ctx->walk_control_obsolete in damon_new_ctx() Date: Wed, 16 Sep 2026 21:05:30 -0700 Message-ID: <20260917040537.107341-5-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260917040537.107341-1-sj@kernel.org> References: <20260917040537.107341-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_walk() should be called for a damon_ctx context that has successfully started at least once. That's because damon_ctx->walk_control_obsolete is initialized when kdamond starts. If the rule is violated, an indefinite wait can happen. There is no existing violation of the rule. damon_call() had a similar rule, and it turned out keeping the rule is not easy for damon_call()'s case. Hence, commit 8023b5f47e09 ("mm/damon/core: set ctx->call_controls_obsolete in damon_new_ctx()") added the initialization in damon_new_ctx() and removed the rule. Keeping the rule for damos_walk() is relatively easier. But having slightly different rules for similar functions could be confusing. Sashiko, for example, repeatedly asked questions about this. Do the initialization of walk_control_obsolete in damon_new_ctx() for consistency. [1] https://lore.kernel.org/20260915011614.102342-1-sj@kernel.org Signed-off-by: SJ Park --- mm/damon/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index 7bbbd44379301..9120a1b707b24 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -939,6 +939,7 @@ struct damon_ctx *damon_new_ctx(void) INIT_LIST_HEAD(&ctx->schemes); =20 ctx->call_controls_obsolete =3D true; + ctx->walk_control_obsolete =3D true; prandom_seed_state(&ctx->rnd_state, get_random_u64()); =20 return ctx; @@ -2308,10 +2309,6 @@ int damon_call(struct damon_ctx *ctx, struct damon_c= all_control *control) * passed at least one &damos->apply_interval_us, kdamond marks the reques= t as * completed so that damos_walk() can wakeup and return. * - * Note that this function should be called only after damon_start() with = the - * @ctx has succeeded. Otherwise, this function could fall into an indefi= nite - * wait. - * * Return: 0 on success, negative error code otherwise. */ int damos_walk(struct damon_ctx *ctx, struct damos_walk_control *control) --=20 2.47.3 From nobody Fri Sep 25 02:08:28 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 7418A3BAD9B; Thu, 17 Sep 2026 04:05:47 +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=1789617948; cv=none; b=UIweDc/aOM+GvpBNt6NVlbbytbiE2wz9scIOV31wIDrrdu1miVgUUOjZnmrfFU3d0kr14Mzoy89+YsD7LO2bktX15kSR7MKMtUmhgpnZAUGFzU9Q2RDyja2m/RVrYeUyyTw1Ig3ycns+6twER8+AV1voAVISeKKSPtL9k47RdZ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789617948; c=relaxed/simple; bh=zSd+wfrLNBdoTYpJpypQJCgPEGzNzXZPKdCdD38W3Ro=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iicFoLxKKuQeBV8KiaooTec8KOQS2HwvXjR+q+UDFFztQ2f4TncvI+d8oXnaIiOqNs8M2ZdPoWQXgmdeodgoYdRijqIDhnfRqvOE9lX6TjlwzXuZN64MYyZGmprvYrsrRYVyTYg4SBCE1dnhLkOzz/rsWrNUw9AdMonXVrsQ5hc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BDrMbsUu; 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="BDrMbsUu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C85021F0089C; Thu, 17 Sep 2026 04:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789617947; bh=l/c0lu/EMv2gJrvNjrzhKVo1VbWsy1nBw4kXQJeK/aY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BDrMbsUuGSlCcvJd9rnxO7G4W6iOoXII7+66r3nRFIkXd/bRucgQslBSCC1PW3Dxl wKA7zhuIIx40uXKulHo5dV6Qx/2BETdZg6+aQi12rTbhw9z3a0xgRAp07jfbntSLsv 6JBZXBXEtnAmai9lEDrv9/Xn0jXBVn2DGEQ0qXdtSkimoiTpZEUr/2ZwdLkphSOLlb EHKUaD+noVqV5mtcHwvNgg4dR3aBXMc3+dtqLjSQ91pNVmnoxeK7PbV+p0SpKGgPT8 CXRTYhgxh6eiLET0ux6wZtKNYhvId0107jWKDBUdP5iZk9Z5nmgAW4tBifsZ3RuVFG T6vUi45ghfNHQ== 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 v2 05/10] mm/damon/core: document damon_call()/damon_start() race hang issue Date: Wed, 16 Sep 2026 21:05:31 -0700 Message-ID: <20260917040537.107341-6-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260917040537.107341-1-sj@kernel.org> References: <20260917040537.107341-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" Let's suppose damon_start() and damon_call() are executed in parallel for the same DAMON context. Then, damon_call() could show ctx->damon_calls_obsolete set while ctx->kdamond is unset. If damon_start() sets ctx->kdamond before damon_call() starts the cancelling, damon_call() can indefinitely hang. No DAMON API caller does such parallel execution of damon_start() and damon_call(), so the issue doesn't exist. But who knows what will happen in future. Add a clarification comment for caution. Signed-off-by: SJ Park --- mm/damon/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/damon/core.c b/mm/damon/core.c index 9120a1b707b24..4687b909d42c9 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2258,6 +2258,9 @@ int damon_kdamond_pid(struct damon_ctx *ctx) * * When this function is failed, the @ctx is guaranteed to be stopped. * + * This function should not be called in parallel to damon_start() for the + * @ctx. In the case, this function could indefinitely hang. + * * Return: 0 on success, negative error code otherwise. */ int damon_call(struct damon_ctx *ctx, struct damon_call_control *control) --=20 2.47.3 From nobody Fri Sep 25 02:08:28 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 740F23BAD88; Thu, 17 Sep 2026 04:05:47 +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=1789617948; cv=none; b=AtvOamMHQlbuGVkEkVSTY+Anej7n7aByNUZu/N4AD96zslBrO/HjKTS3IL7GhHLBY3AumZv0m2KJwdEhMuiFc+Yro6jkLZRqrERBY62pxMjKfRUMvygNGmgA1kMoNCBZYYQCCFRdex+bT7K2A/CUT1swWnPLYnAEpP5Ko/y8brE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789617948; c=relaxed/simple; bh=Ddkx7ZTSFvFyvhnKdja06+laaOkv/3+hcb3Kam2zg7Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JGOgAKwylZNV1EMo9K/Omq5wupvaAMPc4HyCd5amw8GxJZXl6CYa3/bljx2pX+E6N0RTKwl1iWXwHP8yPWCOw1wBUvfx0PG8QW/30+WO3Jjy+Nim9jG6V/jp1dkldQI7rlNkXPgKAmhJneRmLRRfu9IZTURLCmYqRqK6tdAqjwk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eVJlBFLu; 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="eVJlBFLu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 204D71F000FF; Thu, 17 Sep 2026 04:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789617947; bh=3HzbqHqjQymjaA7BsBDU1/xd02tq5ixlWdlSiDNtUtY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eVJlBFLuAAEcE0McA4H2A92moJphJQNyCLtRJOYqmffUyhdzTDtPz7AZYB3R4kvC1 VV5/cE5e2xkL+odrzu3tuJrCLgimM6mOCCZ1rqp7plBxPXC1GrN8a/YQEWLjqBwqU/ Tn1Sm0drOOrkqUO+dhSvHfnqdPNMMrR0whTPqnkAJzgYa1nEW+GdHt3Gb8cpSqJp9S vOfNdgrXvPy9Rtv1W8hrLqZwmxZHypptUhbe3Mx+6dpSYeNUOg2cxXx+9p8dAxKPPC /dqx9dDWBGV4XC/bvLjTCDGfP/xz2FUkDXx1PWB/Q8UzTGTTL7c4MKnlSwgcQLTnFq t2uWbKUmxBxOA== 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 v2 06/10] mm/damon/paddr: remove pa parameter from damon_pa_filter_pass() Date: Wed, 16 Sep 2026 21:05:32 -0700 Message-ID: <20260917040537.107341-7-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260917040537.107341-1-sj@kernel.org> References: <20260917040537.107341-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_pa_filter_pass() receives the 'pa' parameter, but doesn't use it. Remove the parameter from the function signature. Signed-off-by: SJ Park --- mm/damon/paddr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 5abfabaa339e0..2cfdc356b4157 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -163,8 +163,7 @@ static bool damon_pa_filter_match(struct damon_filter *= filter, return matched =3D=3D filter->matching; } =20 -static bool damon_pa_filter_pass(phys_addr_t pa, struct folio *folio, - struct damon_probe *p) +static bool damon_pa_filter_pass(struct folio *folio, struct damon_probe *= p) { struct damon_filter *f; bool pass =3D true; @@ -200,7 +199,7 @@ static unsigned int damon_pa_apply_probes(struct damon_= ctx *ctx, ctx->addr_unit); folio =3D damon_get_folio(PHYS_PFN(pa)); damon_for_each_probe(p, ctx) { - if (damon_pa_filter_pass(pa, folio, p)) + if (damon_pa_filter_pass(folio, p)) r->probe_hits[i]++; i++; } --=20 2.47.3 From nobody Fri Sep 25 02:08:28 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 D3DA03BBFB4; Thu, 17 Sep 2026 04:05:47 +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=1789617949; cv=none; b=RHSb/wCPbmLdMELF6hnRruHqBzWB8wDsN4snVbED9R0P6z9U+cRf9xGMZKD2mvdk9PgVJ+mYTbPqXCTgfxmuYt5bx2QQe7pi5H7EuS997K7GhUinr1gYWO7MwYNT8Yl35sqT79AkP/aIKKqnjRoU5rKhC3fJ4ssaroTU+XrDBtY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789617949; c=relaxed/simple; bh=3waL/h3q7DZwEaKW66X8co0xhOUYc545eSn+/YM2mqQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uTpToZp9GMdSbKE5dmDEa3l4QdeY2cr+Zp8TcxdJ6oOjjzETT/3NYb4xm48IMkykfjczUc5xPfyOf1bkXQZgCarp6+FzJQORWdJ2uAqRgeonGyTyn/UG9ralo9TDBJhGNdSx5xzQGdf1N2oWq8Bz374PZmah94DQw2Yu9bAWSF0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NLy5Z/jH; 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="NLy5Z/jH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EE3B1F00898; Thu, 17 Sep 2026 04:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789617947; bh=PDYFtYaMI0AhnykvPFvkzlsotZmDoTCT5c0S8nqI1O4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NLy5Z/jH1+4dW/Yv3fuWWsqcwJbHuH4Bx4sq02CzSo0x9EY1cLKhIflZFhRTlu0/f AY6MfHFCp3fRe5oU1QbtD+4yHCYdzXR7W00DWNScRkznBrhufu+aID6C/Hp/cyRKTu C2vkv+AoIhr1n9Ghwr/tfXfb1mkR0Koi3velQZlIbMt77XNMtsJYF7l8U+fHvtOhLQ /gMfhtJ2GWYbc0CMeuZX0o12UAzebRzYCaZCyGNPDCt8Uc53PEPXOS1uLaPUYwFSou smGV+thHWKYurYjIQXR1DBmtSEC1Ce6M09b5AbNPCSuDguhyvkZxlWcgEZagI+W0uy 4yYWJsNOPBJ2Q== From: SJ Park To: Cc: SJ Park , Andrew Morton , Brendan Higgins , David Gow , damon@lists.linux.dev, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH v2 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment Date: Wed, 16 Sep 2026 21:05:33 -0700 Message-ID: <20260917040537.107341-8-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260917040537.107341-1-sj@kernel.org> References: <20260917040537.107341-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" There was a DAMOS quota goal commit bug [1] that doesn't update the nid field for DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP metric goal. Add a kunit test case for confirming nid commitment. [1] https://lore.kkernel.org/20260827045035.94611-1-sj@kernel.org Signed-off-by: SJ Park --- mm/damon/tests/core-kunit.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 82c542afaa60e..1244cfeae5e70 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -835,6 +835,9 @@ static void damos_test_commit_quota_goal_for(struct kun= it *test, KUNIT_EXPECT_EQ(test, dst->nid, src->nid); KUNIT_EXPECT_EQ(test, dst->memcg_id, src->memcg_id); break; + case DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP: + KUNIT_EXPECT_EQ(test, dst->nid, src->nid); + break; default: break; } @@ -898,6 +901,13 @@ static void damos_test_commit_quota_goal(struct kunit = *test) .current_value =3D 345, .last_psi_total =3D 567, }); + damos_test_commit_quota_goal_for(test, &dst, + &(struct damos_quota_goal){ + .metric =3D DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP, + .target_value =3D 12, + .current_value =3D 345, + .nid =3D 6, + }); } =20 static void damos_test_commit_quota_goals_for(struct kunit *test, --=20 2.47.3 From nobody Fri Sep 25 02:08:28 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 A5AA33B775A; Thu, 17 Sep 2026 04:05:48 +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=1789617950; cv=none; b=qIUj0fjP8APZ+qDZFABWTHPP28cQlpbsRXRDDicpz0vYiNIdOTym0Im1KkKIsFSKbg2nDffx7N6nP3jB+351k+YnQGF1kpsC37LjfDZFg9N7CBnNXEn4D+jsSrV1jJgpoDfWfePJkzpcUIfRl+XnONT6/nwmMWxuwbqhknh1q94= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789617950; c=relaxed/simple; bh=snrSQKW8Uoh93Q7sQbLRi7Hk1JT19chDk6GmQkiSwlo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EE8cUeh7q/3k88wnQjaYhOdRAHEvMIwI++41+4q3G+Gcp2IIULdBcpE//hLNGNrB05RynuuM1Uerwuu8YjB0jJYRPL1TW/kzjEd+OdQLFloebyWgJeIC1DBCftotqULI11iEbofwh6Lzs3wCZBqDTJ+f4Unl6ckmL7mZ77IfPb8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=anOYjV8W; 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="anOYjV8W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E19341F00899; Thu, 17 Sep 2026 04:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789617948; bh=YMhruRxJ71aCSjWmA7d/+kJKddMflnbOBghZf4lSJQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=anOYjV8WCsTVncf3Vj6GaK/Mje5Z954BIPh7Ig2bs0MwnSsePdkjJNjToRs7jZ8Ql sx71PURDHbmgVwzK3TSL0mqjxtVj5D11bJnnGzmWa/5thquojlNAwFwxi8hS67ZmQz LDnEJEuaDWGfs28g9XjhJvInrUE5/j+ZB/xrft8CKJ3cpjNn3UQ/s9JRRUB3r4Tgyr MvbTtcccdwLMt21apoMLyArSvBDzxTFZcQWCe5IOfrS73WVpTSnXcTyGBrlEH4AHox D6OUEMYyUb4F8TAJSq80mU7ErhD8NaNlob9QNncLXBqsKw4Zc6dtLPRbQyAMXzs4Y2 jEm/M143L3rbg== From: SJ Park To: Cc: SJ Park , Andrew Morton , Brendan Higgins , David Gow , damon@lists.linux.dev, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH v2 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test Date: Wed, 16 Sep 2026 21:05:34 -0700 Message-ID: <20260917040537.107341-9-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260917040537.107341-1-sj@kernel.org> References: <20260917040537.107341-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 commit kunit test lacks test cases for probe_hits_wsum filter type. Add test cases for probe_hits_wsum type DAMOS filter commit. Signed-off-by: SJ Park --- mm/damon/tests/core-kunit.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 1244cfeae5e70..df84d9cc7d204 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -1166,6 +1166,10 @@ static void damos_test_commit_filter_for(struct kuni= t *test, KUNIT_EXPECT_EQ(test, dst->sz_range.min, src->sz_range.min); KUNIT_EXPECT_EQ(test, dst->sz_range.max, src->sz_range.max); break; + case DAMOS_FILTER_TYPE_PROBE_HITS_WSUM: + KUNIT_EXPECT_EQ(test, dst->range_min, src->range_min); + KUNIT_EXPECT_EQ(test, dst->range_max, src->range_max); + break; default: break; } @@ -1239,6 +1243,22 @@ static void damos_test_commit_filter(struct kunit *t= est) .allow =3D true, .target_idx =3D 6, }, false); + damos_test_commit_filter_for(test, &dst, + &(struct damos_filter){ + .type =3D DAMOS_FILTER_TYPE_PROBE_HITS_WSUM, + .matching =3D false, + .allow =3D true, + .range_min =3D 12, + .range_max =3D 34, + }, false); + damos_test_commit_filter_for(test, &dst, + &(struct damos_filter){ + .type =3D DAMOS_FILTER_TYPE_PROBE_HITS_WSUM, + .matching =3D false, + .allow =3D true, + .range_min =3D 34, + .range_max =3D 12, + }, true); } =20 static void damos_test_help_initailize_scheme(struct damos *scheme) --=20 2.47.3 From nobody Fri Sep 25 02:08:28 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 D5E233A1E96; Thu, 17 Sep 2026 04:05:48 +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=1789617950; cv=none; b=ShhCXx9YSxI2olFQt8dfFmVKw9TFyiG/RR4ZTp7p39MqUhhTC9slqdH+Vzy5/o4QbHnTMU/G1aEnxIDsRUhwiptllxO95kEKG06KKqkQu6dE+/f9Ai6A0ucxfmkz5Ss2p9IL38vHtmwI3/o4h9hpGzhzUyKoF1oztKJgL0R3pRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789617950; c=relaxed/simple; bh=A1z4Z4sthlAAWZL5uA0t1iSAT474A3nS6REx5/reAVY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ixyzm4I50gVuNqQjUuk2trQOzqWJrlkk9/xU8baXqpV1VHpfwIMZ/wYqGiF8Sl8uv6Abe23HFkABKjOoBf7+4ODx4/uAk+Etjp3D6K48pNjhXTlB54aTw0TbUBl0k8ej5Tjwk6LXVuEUQEbak6KBS5Jps0e2YYUb+/A6HsVARMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EbEGiilU; 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="EbEGiilU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BCD21F00893; Thu, 17 Sep 2026 04:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789617948; bh=x2I5kTm00UAvsmFfDHBSWc1OoiPGJbIihaNhsLMlExs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EbEGiilUtHvbzcSVprrfwDriaLz1NcBFIFM7f+aKOBKL5mNKgovest/pgKTyy5YD4 q8G5E7jBqfdniulKmM4jZQ3ocxy1WRjfza8t48i0O9pG7meisCBpe6X+F2LFa1/Qef DAIcZ/A8WAgBUOuEHnvM+oc7e3acTkiGT/g5992vV7hzAOy4IUF8Opf72l9/s4xu+o uRzTsCjXOn943Tow283EKz63/wja1kzfJq04X58A78KYd+k5zDXLOFdcf2YCiSRQJE CSIkjSovOmcpaB1sT7B69qa8jRDMee6hDfAEuWcSr8o0ke+3xJ8ffdab/PhuGj1aJQ QKmaZrT1cOEQw== From: SJ Park To: Cc: SJ Park , Shuah Khan , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH v2 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak Date: Wed, 16 Sep 2026 21:05:35 -0700 Message-ID: <20260917040537.107341-10-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260917040537.107341-1-sj@kernel.org> References: <20260917040537.107341-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" The selftest can fail for any leak if it happens while the test is running. Remove the false positive test failures by further checking if the expected leaking function is called out on the report. Signed-off-by: SJ Park --- tools/testing/selftests/damon/sysfs_memcg_path_leak.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh b/tools= /testing/selftests/damon/sysfs_memcg_path_leak.sh index 33a7ff43ed6cc..34c37129c49fe 100755 --- a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh +++ b/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh @@ -41,5 +41,12 @@ if [ "$kmemleak_report" =3D "" ] then exit 0 fi +if ! echo "$kmemleak_report" | grep "memcg_path_store" --quiet +then + echo "[WARN] memleak found; apparently not from DAMON, though" + echo "$kmemleak_report" + exit 0 +fi + echo "$kmemleak_report" exit 1 --=20 2.47.3 From nobody Fri Sep 25 02:08:28 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 6B5843C3F51; Thu, 17 Sep 2026 04:05:49 +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=1789617951; cv=none; b=GpkOdYrPf22CmXaS6w5CELecXFhsu5QzU0+NOwfcleCiojv4ffVkXjeakkK595w7J37R3EeIKGosL8E3bsZglygQnVv2Vw5SKiClmQFmnDGJWJDk5ND62v2KruLPlZZFpg65S1NJvVzl1a1ee+6uehFYDzEunG+cUjf7bZZwQVs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789617951; c=relaxed/simple; bh=Eqre9EVQ7YlVbIBp2jqspJzGDFxFiz5ITzxRB7dmjSU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TVj8NQXAvbgqrqFY8AvTz4Q8vE8t+vmLGS9T0hEzKEQPoohiQ8rD4MGyOOF98HmGx+yzFNzhZiXA2HHA7VofsDfo7SqZxWxaFbnQDvLLcLgV5gHOLLgum7tlQZ8y6KNsRq9/osl7waLMA6GUE88uUYsoZ4th9IJ9N1Ar9I/dFFY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GhN2puzE; 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="GhN2puzE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B48691F0089B; Thu, 17 Sep 2026 04:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789617949; bh=Mozf9eR83klndQFJraTt18kHcl1hxd6yOHCmDoYKrX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GhN2puzEsWiLv7s8wcGaPWWWFYfc1kACptDmFKSTdaoePt3/+GPX8BMMgRD3+GIKC S4nfxqpdKNvJqtKASnnu/vk47kNDkTULgZCFUH0L7TowQXoA0A7UiFeWHBloVXRa5n FrNaeF9cNUq3qq1RyAX1viVPh6HwjgiYC3VR/Ap4tkMhLfZ+3ufUSti61FyoU4JRDe DX9CC8elLVbULwp0z+5LPeilDddi0plmtHLv+XK+GIVpP7jxItIuMB+t2UHOCRqDec 7raemiTAjfgKfRywm7kLR5JKOGzLnt1U9hDheawk4CluP8C5YojvSHQ9cnMtR/URik V8rYQJKHyUPkg== From: SJ Park To: Cc: SJ Park , "Liam R. Howlett" , Andrew Morton , David Hildenbrand , Jonathan Corbet , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Randy Dunlap , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , damon@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH v2 10/10] Docs/mm/damon/design: clarify bp is basis point Date: Wed, 16 Sep 2026 21:05:36 -0700 Message-ID: <20260917040537.107341-11-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260917040537.107341-1-sj@kernel.org> References: <20260917040537.107341-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 design document uses "bp" for "basis point" in multiple places. Because it is not clearly mentioned, it is difficult to understand what "bp" stands for. Add the clarification. Reported-by: Randy Dunlap Closes: https://lore.kernel.org/107dc6ba-697e-4b25-ba3e-8ce2499cac9a@infrad= ead.org Acked-by: Randy Dunlap Signed-off-by: SJ Park --- Documentation/mm/damon/design.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/des= ign.rst index 0a86792f90a18..e82390e77a70a 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -445,7 +445,7 @@ users to set the aimed amount of access events to obser= ve via DAMON within given time interval. The target can be specified by the user as a ratio of DAMON-observed access events to the theoretical maximum amount of the even= ts (``access_bp``) that measured within a given number of aggregations -(``aggrs``). +(``aggrs``). The ratio is in basis point (bp or 1/10,000). =20 The DAMON-observed access events are calculated in byte granularity based = on DAMON :ref:`region assumption `. For @@ -717,7 +717,8 @@ mechanism tries to make ``current_value`` of ``target_m= etric`` be same to in microseconds that measured from last quota reset to next quota reset. DAMOS does the measurement on its own, so only ``target_value`` need to = be set by users at the initial time. In other words, DAMOS does self-feedb= ack. -- ``node_mem_used_bp``: Specific NUMA node's used memory ratio in bp (1/10= ,000). +- ``node_mem_used_bp``: Specific NUMA node's used memory ratio in basis po= int + (bp or 1/10,000). - ``node_mem_free_bp``: Specific NUMA node's free memory ratio in bp (1/10= ,000). - ``node_memcg_used_bp``: Specific cgroup's node used memory ratio for a specific NUMA node, in bp (1/10,000). --=20 2.47.3