From nobody Sat Sep 26 14:38:04 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 24E4049F117; Mon, 31 Aug 2026 14:26:24 +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=1788186385; cv=none; b=J6ecVoSiS/xMpz9eNF/72yE0oNIRe26EbPFMF9VUK9su2lGbhR9D5cwHlztU4AVxveHQ+OPRElmoEN6l3WFnQ/mxpOAaKpOqAufItGnMTzo4KiS0U+IKrRSqHUpxpYs2RqPNmYBevWCxOiWZpWPoeo8mV6Jau+qc0H876oEswZw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788186385; c=relaxed/simple; bh=aVdWKKuRk8nkHDpzmEb77cT15+azH/FUhxdnKjZpuIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i7HTWtxviOaVEMIQmYyTGY4ohtPceG8TQMzvFV9QKFX9XhCkVwG55u8x0PdfbYtAZWOuyegjuf7p3+5h3J48c1oVsH5fTkAjbvBDyH6rKm1L6+GXPUQAgbK+3oilLv5tu13hPJ9sZ+rhwW8GJM1+k8lxHNUji1zYK8H6zV7xl8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OOnu/tWm; 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="OOnu/tWm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D38F11F00A3F; Mon, 31 Aug 2026 14:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788186384; bh=j0ux2Ajr+KLUU8fQjRJzy/leuNsARMPnQOrajKg2u/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OOnu/tWm7FfN/WVmuah++vaeUv4DTc82sDlwfcr2fojF5ZyGY1ykULsmmlY5KU12p tT56GE1m+DVb8VmGJzfdb7Awq9W4WmaX5D5fOuECuUGO+ZEKDO4r4RmWiOr2M821vI 2SeZlnWf5CULk4zQd2cQ2/0cy+hkpUiDq894szbRuHeGbG+gD2ecFNJ6wmFpA6wPXn sFMeKH5ncp+HwYNPBy50vTiy4AGoUnWRrFr+q6p6o7Z9nZfBdZJsXs7O0MouB8kcuW dnFZt459wBFA+cGkZqr27oXM1TsX5DLpIZU17wb/bf5sSL2jYUwIXqcUf8VixxYxN9 LQMbH3H8wLu6Q== From: SJ Park To: Andrew Morton Cc: "Zenghui Yu (Huawei)" , SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/7] mm/damon/core: remove declaration of __damon_commit_ctx() Date: Mon, 31 Aug 2026 07:26:03 -0700 Message-ID: <20260831142611.77572-2-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260831142611.77572-1-sj@kernel.org> References: <20260831142611.77572-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" From: "Zenghui Yu (Huawei)" It was added by commit b1471afe4d10 ("mm/damon/core: do parameter testing commit on damon_start()") but is actually not needed. Remove it. Changes from v1 - v1: https://lore.kernel.org/20260806170701.79266-1-zenghui.yu@linux.dev - Collect R-b: from SJ. - Rebase to latest mm-new. Cc: "Zenghui Yu (Huawei)" Signed-off-by: Zenghui Yu (Huawei) Reviewed-by: SJ Park Signed-off-by: SJ Park --- mm/damon/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index b3f8bea774c2d..79515ef03fc2a 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1961,8 +1961,6 @@ static int __damon_start(struct damon_ctx *ctx) return err; } =20 -static int __damon_commit_ctx(struct damon_ctx *dst, struct damon_ctx *src= ); - /** * damon_start() - Starts the monitorings for a given group of contexts. * @ctxs: an array of the pointers for contexts to start monitoring --=20 2.47.3 From nobody Sat Sep 26 14:38:04 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 B59E547FB00; Mon, 31 Aug 2026 14:26:24 +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=1788186386; cv=none; b=qw3JI7SdbFhg26YUUnBnP1uadWUxmdmhfFdNST/jUarCoLxquMTAjzDx0k8sImd8n+sDZzmxnF0eSfdMDQPq3Wdb+Bq7dNmXzHBhPeDhQvztLxIsXNCurNg/0TU8w1WKuUeGzhw5kL7q8MwzNdVyB9goxLMFpL+yPuZtfT2WmAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788186386; c=relaxed/simple; bh=Wz8lAfnxNB0fjX33N+sTEhww9kVKTOuYQ90cifUw4mQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HuYk5byvPHHQXP+dSTPfQpyRoBVmec92UQJPtoABPrWtmcV3z2CjRLQ/u14cw40wrjc7poUZuchDf3E4Wesen0vY0wuLq1aX54R2VKnyowT9xwK59TgVVZx/PtgT8mv3sdIGCkPg3ZNUGSqI/rHqZ13soW2grLlGTzyjOv9OCew= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mXISkcR2; 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="mXISkcR2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31C211F00ACA; Mon, 31 Aug 2026 14:26:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788186384; bh=LxE82nkNHWov4YHh70ccGFi1HMEiweXojbw3QLwGVKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mXISkcR21FUdW6a/GHUr4gjTlrQNC5SepoKIMDlA8PCrso0C3aUK0Y4Vc4twXVww6 mKIgxHAcMOhLn9V/ud5FTRgPbej+8aPVnwIx8jQyxbkNQXZHuQ636PFQkO4e9kNAKX pAqtEDmhrRUmzod6BmtXnzcsPiGPeriWGM1P8TpqarpDXWk/r30UV/CC38i2iizggF ot6ihp+foSRcxRccDiLAdTqp08QI7uWSKVOMYKuRY+JO9lpcTKuqK2ew6cBfFs9w/8 zUjl+p8JBTiX4iVOheHvGFfeYSgoCNa3JjmS188DObHYGqtAW7qwt+vtsqEcM2lNwM S6UVL+CZp9Crg== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Enze Li Subject: [PATCH 2/7] mm/damon/core: introduce damon_set_target_pid() Date: Mon, 31 Aug 2026 07:26:04 -0700 Message-ID: <20260831142611.77572-3-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260831142611.77572-1-sj@kernel.org> References: <20260831142611.77572-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 logic that finds the struct pid for a given pid number and assigns it to a damon_target is duplicated in multiple places. Including damon_sysfs_add_target() of mm/damon/sysfs.c and the start functions of the two sample modules, samples/damon/wsse.c and samples/damon/prcl.c. Add a function that does the work, and replace the duplicated code in the places with calls to the function. Signed-off-by: Enze Li Reviewed-by: SJ Park Signed-off-by: SJ Park --- Changes from v1 - v1: https://lore.kernel.org/20260817125319.888994-1-lienze@kylinos.cn - Collect R-b: from SJ. - Rebase to latest mm-new. include/linux/damon.h | 1 + mm/damon/core.c | 12 ++++++++++++ mm/damon/sysfs.c | 6 ++---- samples/damon/prcl.c | 5 +---- samples/damon/wsse.c | 5 +---- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 0c8b7ddef9abb..5607f98ec6306 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -1055,6 +1055,7 @@ int damos_commit_quota_goals(struct damos_quota *dst,= struct damos_quota *src); struct damon_target *damon_new_target(void); void damon_add_target(struct damon_ctx *ctx, struct damon_target *t); bool damon_targets_empty(struct damon_ctx *ctx); +int damon_set_target_pid(struct damon_target *t, int pid); void damon_free_target(struct damon_target *t); void damon_destroy_target(struct damon_target *t, struct damon_ctx *ctx); unsigned int damon_nr_regions(struct damon_target *t); diff --git a/mm/damon/core.c b/mm/damon/core.c index 79515ef03fc2a..a5ea3e61e7f41 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -802,6 +803,17 @@ bool damon_targets_empty(struct damon_ctx *ctx) return list_empty(&ctx->adaptive_targets); } =20 +/* + * Assign the struct pid of the given pid number to the given target. + */ +int damon_set_target_pid(struct damon_target *t, int pid) +{ + t->pid =3D find_get_pid(pid); + if (!t->pid) + return -EINVAL; + return 0; +} + static void damon_del_target(struct damon_target *t) { list_del(&t->list); diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index f05b256c90ee7..dcb739ce0a729 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -3,7 +3,6 @@ * DAMON sysfs Interface */ =20 -#include #include #include =20 @@ -2036,9 +2035,8 @@ static int damon_sysfs_add_target(struct damon_sysfs_= target *sys_target, return -ENOMEM; damon_add_target(ctx, t); if (damon_target_has_pid(ctx)) { - t->pid =3D find_get_pid(sys_target->pid); - if (!t->pid) - /* caller will destroy targets */ + /* caller will destroy targets */ + if (damon_set_target_pid(t, sys_target->pid)) return -EINVAL; } t->obsolete =3D sys_target->obsolete; diff --git a/samples/damon/prcl.c b/samples/damon/prcl.c index 842099bd62286..83ddf12811d57 100644 --- a/samples/damon/prcl.c +++ b/samples/damon/prcl.c @@ -32,7 +32,6 @@ module_param_cb(enabled, &enabled_param_ops, &enabled, 06= 00); MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_PRCL"); =20 static struct damon_ctx *ctx; -static struct pid *target_pidp; =20 static int damon_sample_prcl_repeat_call_fn(void *data) { @@ -79,12 +78,10 @@ static int damon_sample_prcl_start(void) return -ENOMEM; } damon_add_target(ctx, target); - target_pidp =3D find_get_pid(target_pid); - if (!target_pidp) { + if (damon_set_target_pid(target, target_pid)) { damon_destroy_ctx(ctx); return -EINVAL; } - target->pid =3D target_pidp; =20 scheme =3D damon_new_scheme( &(struct damos_access_pattern) { diff --git a/samples/damon/wsse.c b/samples/damon/wsse.c index 37fd5da201588..53944aea8428e 100644 --- a/samples/damon/wsse.c +++ b/samples/damon/wsse.c @@ -33,7 +33,6 @@ module_param_cb(enabled, &enabled_param_ops, &enabled, 06= 00); MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_WSSE"); =20 static struct damon_ctx *ctx; -static struct pid *target_pidp; =20 static int damon_sample_wsse_repeat_call_fn(void *data) { @@ -79,12 +78,10 @@ static int damon_sample_wsse_start(void) return -ENOMEM; } damon_add_target(ctx, target); - target_pidp =3D find_get_pid(target_pid); - if (!target_pidp) { + if (damon_set_target_pid(target, target_pid)) { damon_destroy_ctx(ctx); return -EINVAL; } - target->pid =3D target_pidp; =20 err =3D damon_start(&ctx, 1, true); if (err) { --=20 2.47.3 From nobody Sat Sep 26 14:38:04 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 D9B1F49F124; Mon, 31 Aug 2026 14:26:24 +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=1788186388; cv=none; b=e5SJnM1bBCMLnfJjG4kFqhKLiITxltvXDm+42GlFDCY104SORbBM6/YGTiwoY2jBiS3nmMM97ivs2/vMVQhZpCwJ0NF13h8grG0G+JX+VxbjpX8Mtr1ypaBot6w0Iz9xXJD5SX610NBq9gOMU6uFSmZgKxku1Pi7SOU50QBz2bU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788186388; c=relaxed/simple; bh=cAxH+FQImjIHhDQ4CddMNt7r1x1NdRpj8H2hlk8EDEY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IQvPHl6568fiqKwiiHJWEPruht9emy2bIJt2lsIbbqflI38xeZWXnljxjarOJBqOEAONrJKGKb7Dag0S+ur9FetapaccR9kK8fsWYAj/IYAlQgyvrD94Z/jNuwrjM18GSDQ/kb9/h2WL1dqc7bnf6EJgsjz1aV8hMmrGwQONP4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bxBtxJIO; 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="bxBtxJIO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 875591F00A3E; Mon, 31 Aug 2026 14:26:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788186384; bh=+x+8VzAIyEFRtjjppXXd0Fa0HpYfRCyX/dog/XxHT84=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bxBtxJIO003RZUnygIKZ3OXt7NF5DiVsifsOtcqU97JTvnoq/g5TI693DWnBLJa7A E0FKTpCHFsU5xOUHCOjccOYZgan1zMZo4q1B+Se9DZhFiBRcQ/SMjqz0IdGU9jeItq 82aUnOVfFkFjag3u1oF4GHzTc1zb7PfkuD3MI5BKOnzy+DpKgTQ9oODbMgmxU+jf32 x7Y8wQ9eqA/STpjnWIalK/UIW1h8lFksVA93fYyKTMWjyJ3kXDfn2KiGsau2Avlq4S n+QwiTDN68KSS1lTtYy5NOZls55eMVxiVhbpr12wprl2tIgEl1CleCn02PF9q7lypo +pafQn6JFqaIA== From: SJ Park To: Andrew Morton Cc: Li Youhong , SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 3/7] mm/damon/ops-common: factor out damon_putback_folio_list() Date: Mon, 31 Aug 2026 07:26:05 -0700 Message-ID: <20260831142611.77572-4-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260831142611.77572-1-sj@kernel.org> References: <20260831142611.77572-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" From: Li Youhong The putback loop is duplicated in damon_migrate_folio_list() and on the invalid-nid path of damon_migrate_pages(). Factor it into a small helper for readability. No functional change. Signed-off-by: Li Youhong Reviewed-by: SJ Park Signed-off-by: SJ Park --- Changes from v1 - v1: https://lore.kernel.org/20260818020650.2844354-1-dayou5941@163.com - Collect R-b: from SJ. - Rebase to latest mm-new. mm/damon/ops-common.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c index fbda70d8ea4d0..7a2e40bc7baed 100644 --- a/mm/damon/ops-common.c +++ b/mm/damon/ops-common.c @@ -330,6 +330,19 @@ static unsigned int __damon_migrate_folio_list( return nr_succeeded; } =20 +static void damon_putback_folio_list(struct list_head *folio_list) +{ + struct folio *folio; + + while (!list_empty(folio_list)) { + folio =3D lru_to_folio(folio_list); + list_del(&folio->lru); + node_stat_sub_folio(folio, NR_ISOLATED_ANON + + folio_is_file_lru(folio)); + folio_putback_lru(folio); + } +} + static unsigned int damon_migrate_folio_list(struct list_head *folio_list, struct pglist_data *pgdat, int target_nid) @@ -371,13 +384,7 @@ static unsigned int damon_migrate_folio_list(struct li= st_head *folio_list, =20 list_splice(&ret_folios, folio_list); =20 - while (!list_empty(folio_list)) { - folio =3D lru_to_folio(folio_list); - list_del(&folio->lru); - node_stat_sub_folio(folio, NR_ISOLATED_ANON + - folio_is_file_lru(folio)); - folio_putback_lru(folio); - } + damon_putback_folio_list(folio_list); =20 return nr_migrated; } @@ -394,14 +401,7 @@ unsigned long damon_migrate_pages(struct list_head *fo= lio_list, int target_nid) =20 if (target_nid < 0 || target_nid >=3D MAX_NUMNODES || !node_state(target_nid, N_MEMORY)) { - while (!list_empty(folio_list)) { - struct folio *folio =3D lru_to_folio(folio_list); - - list_del(&folio->lru); - node_stat_sub_folio(folio, NR_ISOLATED_ANON + - folio_is_file_lru(folio)); - folio_putback_lru(folio); - } + damon_putback_folio_list(folio_list); return nr_migrated; } =20 --=20 2.47.3 From nobody Sat Sep 26 14:38:04 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 930384DB55C; Mon, 31 Aug 2026 14:26:25 +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=1788186386; cv=none; b=l140f87naBon+SYFyni/0pYjR7rx24dt3jSeQQZLLp/SJfmCEfXDvgQJVUU+z7K8045efuXHV7O1TxoseyEMlTM62wxHG/OzBSZD7pnwnEpOwy4W5Tn0mmiiZppcCzYt7XqzpyuEK9auPJD3X7PeEg/aifv3x6FYxvzjyFkgd5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788186386; c=relaxed/simple; bh=52AHWpscdkgOxDQC/IjAQGMK4ImVa0aY9Cmu1KeW4SY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IIBKkoF7vKsBVmYIDqvZreP9OV9xl5zzPXN5J6WbwM7HsgT5FHhSNERjSLpQF2eKymZEHtFWcKz3AoHCOLEGWfUN/3wEjN1fwK7RMw6F9mfXU2GE2t5Z1AG48G5KObwzWsuebnBFpKsI85ZiYVOE5Au8aeb83k+MZTex0q0zzCg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OHlujUnD; 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="OHlujUnD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAE011F00ADB; Mon, 31 Aug 2026 14:26:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788186385; bh=LAx08zJG2wc5FyCWbkPrWuUIZaKIhJkgRdTbl/CuRIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OHlujUnDKJ74pdai6cyj34+LE81FhNPaOCEGRuPRC+P4PskyejWBBZQFhJuAhAChb I4gC+FZY15URgsc3yuzzBPzMELVnnn4TwdM6CLD3OVYCON+SHDqskaxY5sMs7WaUiQ zVxSe3Gy1Og95VTpniMewDkmQ7RGGiOTa9OcxzhFV61tZTxDGxN/rMYMLps++TPRVr P/HlrMtt+EFaDS2BbFqFAoRJ/SXIfDiCzw+J+73dM1zkagurkzWBzgYGnGBC/Cbg2k uMUhEpkQzQbzv+hReiMYnqPPE20WcTUJ9S1bwFX3+pmNgrXr63UilGtufhXvQ/3zij G8q46AjDIAJNw== From: SJ Park To: Andrew Morton Cc: Hari Mishal , Greg Kroah-Hartman , SJ Park , Shuah Khan , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 4/7] selftests/damon/sysfs.py: clean up sh processes used for obsolete_target test Date: Mon, 31 Aug 2026 07:26:06 -0700 Message-ID: <20260831142611.77572-5-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260831142611.77572-1-sj@kernel.org> References: <20260831142611.77572-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" From: Hari Mishal The obsolete_target test spawns three sh processes and uses their pids as DAMON monitoring targets. These processes are never terminated or waited on, so they are left running (or become zombies) as orphaned children after the test program exits. Terminate each process and communicate() with it after the targets are no longer needed, so it exits and gets reaped instead of being leaked. Cc: Greg Kroah-Hartman Signed-off-by: Hari Mishal Reviewed-by: SJ Park Signed-off-by: SJ Park --- Changes from v2 - v2: https://lore.kernel.org/20260722012349.9738-1-harimishal1@gmail.com - Collect R-b: from SJ. - Rebase to latest mm-new. Changes from v1 - v1: https://lore.kernel.org/20260721190404.135937-1-harimishal1@gmail.com - Terminate each sh process directly instead of giving it its own stdin pipe to close, dropping the stdin=3DPIPE changes and shrinking the diff. tools/testing/selftests/damon/sysfs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/damon/sysfs.py b/tools/testing/selftes= ts/damon/sysfs.py index 3ffa054b63867..88a26422ff44c 100755 --- a/tools/testing/selftests/damon/sysfs.py +++ b/tools/testing/selftests/damon/sysfs.py @@ -385,6 +385,10 @@ def main(): assert_ctxs_committed(kdamonds) kdamonds.stop() =20 + for proc in (proc1, proc2, proc3): + proc.terminate() + proc.communicate() + test_memcg_filter_memcg_path_staging() =20 if __name__ =3D=3D '__main__': --=20 2.47.3 From nobody Sat Sep 26 14:38:04 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 B97E34DB560; Mon, 31 Aug 2026 14:26:25 +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=1788186387; cv=none; b=LAEFrO1pNYltcszYaPgaqG1e6fBBMtMpMels1jHzX8kgR6ai16DZUmXa9RDlUbSB+Wpvi3ePny5XG9NbMvWdPucAzpVXkoa8se8/ys1taDMGldGhAtPDHJrKdMHkJ9u/3D1JmB6QeSENmy3KAGalIQPEt0cCzrknPUPxUZRJn60= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788186387; c=relaxed/simple; bh=LmPFijN0srbmeFBjVnA/wHwqxOTM8ysBoVE+a+30+iQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nwryJUe0fNlwKK0gthm9kLUmNkOaqwvciA3waDOeo+pewBs24UBDC4KA/Il9+j2FKuR4RId7CgZ0MhHjvSFuAlAYlDT45LZ8SXKxbvQ44/C43V/3iMCGAP4qGYv/vztt6ITRkAcYhCFaz1FWqbSdETVnnWxd2UTXVNMnLyQjHMQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LKuV2UB2; 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="LKuV2UB2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 523A51F00A3F; Mon, 31 Aug 2026 14:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788186385; bh=5b7EjDYfsY4UBVu5ajlJqmnOtSzQbzeAwcctf4S77Lw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LKuV2UB2InsWQ/SUpl3zP1k3HLngPLcg/I9+ug+j1Z8imWtS5NIK6UqEG+7FVmWFs kUqo4iwx63rdY7RrJMvwZ/cd0FcYXRZkGLcXDa1e2554bPWFBWPzvmiSZnm8TMhlm/ 6ocAQNk0Dh2GMEm0SkwGjsbn/1ktxNqJctJJAOp1DJ1FQnbAQ4OfxZefMYLowmwFqK N7yZD/jcEgKWX6Kkk7UmiEehGVqujNfFFJb90yry5MDLS4OOvj0sHnbNsG8ShVppqO ysdU/bYg+5txGldI5fLTiVv6uMue2Oo2XaOMatZlOaE1YJ8I2bF0ErwS2Ci9oQKsW/ gJYPhKXiASITA== From: SJ Park To: Andrew Morton Cc: Jaeyeon Lee , SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 5/7] mm/damon/tests: use scoped_guard() for damon_test_ops_registration Date: Mon, 31 Aug 2026 07:26:07 -0700 Message-ID: <20260831142611.77572-6-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260831142611.77572-1-sj@kernel.org> References: <20260831142611.77572-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" From: Jaeyeon Lee Replace manual mutex_lock() and mutex_unlock() calls with the scoped_guard() macro. This simplifies the code, improves readability, and ensures that the lock is automatically released when the scope ends, preventing potential lock leaks in the future. Signed-off-by: Jaeyeon Lee Reviewed-by: SJ Park Signed-off-by: SJ Park --- Changes from v1 - v1: https://lore.kernel.org/20260815143039.17291-1-jaeyeon.lee.dev@gmail.= com - Collec R-b: from SJ. - Rebase to latest mm-new. mm/damon/tests/core-kunit.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 65443aba03300..ec7260a3bfea8 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -434,17 +434,17 @@ static void damon_test_ops_registration(struct kunit = *test) KUNIT_EXPECT_EQ(test, damon_select_ops(c, NR_DAMON_OPS), -EINVAL); =20 /* Registration should success after unregistration */ - mutex_lock(&damon_ops_lock); - bak =3D damon_registered_ops[DAMON_OPS_VADDR]; - damon_registered_ops[DAMON_OPS_VADDR] =3D (struct damon_operations){}; - mutex_unlock(&damon_ops_lock); + scoped_guard(mutex, &damon_ops_lock) { + bak =3D damon_registered_ops[DAMON_OPS_VADDR]; + damon_registered_ops[DAMON_OPS_VADDR] =3D + (struct damon_operations){}; + } =20 ops.id =3D DAMON_OPS_VADDR; KUNIT_EXPECT_EQ(test, damon_register_ops(&ops), 0); =20 - mutex_lock(&damon_ops_lock); - damon_registered_ops[DAMON_OPS_VADDR] =3D bak; - mutex_unlock(&damon_ops_lock); + scoped_guard(mutex, &damon_ops_lock) + damon_registered_ops[DAMON_OPS_VADDR] =3D bak; =20 /* Check double-registration failure again */ KUNIT_EXPECT_EQ(test, damon_register_ops(&ops), -EINVAL); @@ -452,10 +452,9 @@ static void damon_test_ops_registration(struct kunit *= test) damon_destroy_ctx(c); =20 if (need_cleanup) { - mutex_lock(&damon_ops_lock); - damon_registered_ops[DAMON_OPS_VADDR] =3D - (struct damon_operations){}; - mutex_unlock(&damon_ops_lock); + scoped_guard(mutex, &damon_ops_lock) + damon_registered_ops[DAMON_OPS_VADDR] =3D + (struct damon_operations){}; } } =20 --=20 2.47.3 From nobody Sat Sep 26 14:38:04 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 0C1CB4DB568; Mon, 31 Aug 2026 14:26:26 +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=1788186387; cv=none; b=SKvLckELNAm98u9mvZQvG1GaD23LMX8pzR1wvJyWdHN2Ez8sY0qafDCCMSvUiao80HuG99YSArAd8hga92rtvOhrS9CoplTW4BWSMEfVnOTcnLMvp68eZU435AiIJXYvPoOFgG02R2laR6MnwksbcpzMGk4s6e77paUaaNQ5bwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788186387; c=relaxed/simple; bh=mBQVBalgo78Gl8oNzOzOSPZT5jyXvkYNsvMckVyOYRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DJQgz+RSOvdiwLIHjyaGer5T2rBlJx3MtFDbiagYTs6ltaFJ7Ez0VSgHEdi1Z1l6XKjJXFx4qADKTJek0Enqf+ZOJkbo1kgrLbmV1HygnBmxHORGkYKgqqt7u5MNOrFLpUKohATpL2raGrjM1tNkcgWb1ednEezcO3puePXZjh8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Em2drk/8; 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="Em2drk/8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8A971F00A3D; Mon, 31 Aug 2026 14:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788186385; bh=Epq3PwHO3KDR58/nXH75JqepBtDLOvPb3QexcmNVybw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Em2drk/829piatKSrCV3QA5FNzUpmoDNkTJymkFxgZCGghcuOO8KN+vmmpxqLBMRB KHQijKDcHukKBQsj4bnDryymd+yQNAjM4XHoL1Qkn7BJFbclE9sljIWB+xz4VYhWf+ dFthQ2P7kG+wW+m0cde2PlPDCwbiU6UlRwcPyNBXFo7jrJp7Jk3QzpE5ldqM1NyT+b HhNTI3nT9KJXzIdAfAEjZApxZDqtEXSBcFtH7VLnVRrdXz2aHy7QaMWARDcc82Dssb Q2Uo7yKo54EqjjGyxkAliod+fxNcUI88HA0LxZO8eZ0RUqyH5BPoXG8t1gFsovLP56 c+92RHPWXh3SQ== From: SJ Park To: Andrew Morton Cc: zhaozhengzhuo , SJ Park , Shuah Khan , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 6/7] selftests/damon: prevent remaining cross-object state pollution Date: Mon, 31 Aug 2026 07:26:08 -0700 Message-ID: <20260831142611.77572-7-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260831142611.77572-1-sj@kernel.org> References: <20260831142611.77572-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" From: zhaozhengzhuo _damon_sysfs.py defines constructors with mutable default arguments, including DamosAccessPattern(), DamosQuota(), DamosWatermarks(), DamosDests(), IntervalsGoal(), and empty lists. Default arguments are evaluated once at function definition time. Damos() instances created without explicit arguments therefore share the same DamosQuota(), and the other default-constructed sub-objects and lists are shared in the same way. The sub-objects keep back-pointers to their owner scheme, so constructing the second Damos() rebinds the shared quota's scheme pointer to the second object. An item appended to one object's default contexts or filters list is also visible from other default-constructed objects. The shared state can corrupt test configurations. DamosQuota.sysfs_dir() derives the sysfs directory from its scheme pointer, so operating on the first scheme's default quota may write to the second scheme's directory. The wrong values often match the defaults, so tests still pass, but the behavior depends on object creation order. Commit 8319dadcbd81 ("selftests/damon: prevent cross-context state pollution in DamonCtx") fixed the same pattern in DamonCtx only. Fix the remaining constructors by defaulting to None and creating fresh objects or lists inside each constructor. Explicit arguments keep their previous behavior. Signed-off-by: zhaozhengzhuo Reviewed-by: SJ Park Signed-off-by: SJ Park --- Changes from v1 - v1: https://lore.kernel.org/38E4AAAAEDFCC283+20260827021515.1316838-1-zha= ozhengzhuo@uniontech.com - Collec R-b: from SJ. - Rebase to latest mm-new. tools/testing/selftests/damon/_damon_sysfs.py | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/= selftests/damon/_damon_sysfs.py index e6a2265d721e8..f604b7d6530b3 100644 --- a/tools/testing/selftests/damon/_damon_sysfs.py +++ b/tools/testing/selftests/damon/_damon_sysfs.py @@ -321,8 +321,10 @@ class DamosFilters: filters =3D None scheme =3D None # owner scheme =20 - def __init__(self, name, filters=3D[]): + def __init__(self, name, filters=3DNone): self.name =3D name + if filters is None: + filters =3D [] self.filters =3D filters for idx, filter_ in enumerate(self.filters): filter_.idx =3D idx @@ -368,7 +370,9 @@ class DamosDests: dests =3D None scheme =3D None # owner scheme =20 - def __init__(self, dests=3D[]): + def __init__(self, dests=3DNone): + if dests is None: + dests =3D [] self.dests =3D dests for idx, dest in enumerate(self.dests): dest.idx =3D idx @@ -426,15 +430,21 @@ class Damos: stats =3D None tried_regions =3D None =20 - def __init__(self, action=3D'stat', access_pattern=3DDamosAccessPatter= n(), - quota=3DDamosQuota(), watermarks=3DDamosWatermarks(), - core_filters=3D[], ops_filters=3D[], filters=3D[], target= _nid=3D0, - dests=3DDamosDests(), apply_interval_us=3D0): + def __init__(self, action=3D'stat', access_pattern=3DNone, quota=3DNon= e, + watermarks=3DNone, core_filters=3DNone, ops_filters=3DNon= e, + filters=3DNone, target_nid=3D0, dests=3DNone, + apply_interval_us=3D0): self.action =3D action + if access_pattern is None: + access_pattern =3D DamosAccessPattern() self.access_pattern =3D access_pattern self.access_pattern.scheme =3D self + if quota is None: + quota =3D DamosQuota() self.quota =3D quota self.quota.scheme =3D self + if watermarks is None: + watermarks =3D DamosWatermarks() self.watermarks =3D watermarks self.watermarks.scheme =3D self =20 @@ -448,6 +458,8 @@ class Damos: self.filters.scheme =3D self =20 self.target_nid =3D target_nid + if dests is None: + dests =3D DamosDests() self.dests =3D dests self.dests.scheme =3D self =20 @@ -568,10 +580,12 @@ class DamonAttrs: context =3D None =20 def __init__(self, sample_us=3D5000, aggr_us=3D100000, - intervals_goal=3DIntervalsGoal(), update_us=3D1000000, - min_nr_regions=3D10, max_nr_regions=3D1000): + intervals_goal=3DNone, update_us=3D1000000, min_nr_region= s=3D10, + max_nr_regions=3D1000): self.sample_us =3D sample_us self.aggr_us =3D aggr_us + if intervals_goal is None: + intervals_goal =3D IntervalsGoal() self.intervals_goal =3D intervals_goal self.intervals_goal.attrs =3D self self.update_us =3D update_us @@ -703,7 +717,9 @@ class Kdamond: idx =3D None # index of this kdamond between siblings kdamonds =3D None # parent =20 - def __init__(self, contexts=3D[], refresh_ms=3DNone): + def __init__(self, contexts=3DNone, refresh_ms=3DNone): + if contexts is None: + contexts =3D [] self.contexts =3D contexts self.refresh_ms =3D refresh_ms for idx, context in enumerate(self.contexts): @@ -853,7 +869,9 @@ class Kdamond: class Kdamonds: kdamonds =3D [] =20 - def __init__(self, kdamonds=3D[]): + def __init__(self, kdamonds=3DNone): + if kdamonds is None: + kdamonds =3D [] self.kdamonds =3D kdamonds for idx, kdamond in enumerate(self.kdamonds): kdamond.idx =3D idx --=20 2.47.3 From nobody Sat Sep 26 14:38:04 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 604C94DB57C; Mon, 31 Aug 2026 14:26:26 +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=1788186387; cv=none; b=dOXMWuFp+nlb17wg5Qz8t4pNxZgKr9v7c+jFMazqnsQFUomVgwiGnG/mxggY6YdtzLFrii7Eylu6eNsPkO41eVh3aRP9jiZwHxLX8C+8FOtkXQ6nIuPtIbVK/OOkyJ+Eb0s/yb89z2jqDdnjSZvVQsk0f8c9eSyhS7Y+A23pRkE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788186387; c=relaxed/simple; bh=eydH6ZjzAqOngpgKfqYhz3xYjQQY7ugG8PooKaSRM+c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Uihii14zP5+8Kp3LMFaCddQDtypy3mLBgMGk+SBaXISMRx5U2RU5X4uiqd78D04uTaonCdPtFXrHb4KK7pE5b5zZuszZnPbMOeQKI8OlUb+Q/eCDZWD08B+RBSiX8l18Kx11JnuND/djSrSXd5ZbYodLk12ER7ky7+IMM+LbEJI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ofv89aVI; 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="ofv89aVI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18C751F00ADF; Mon, 31 Aug 2026 14:26:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1788186386; bh=++mDemjAm3frVYhBHw1yycvSVhXLn1wofYJdDWaaqD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ofv89aVIYd0IbAdoYRts6tCrlsW/biaOf5xmsUAwpzPSRpgIs9Li1GKDDfQWI14Yb nnk6MDzcjK6R/FR4tB182JY1qKk1vs1549StOht7tUz4YeFuUfI5tDZtBna2CypCHe DGaLH/qRgrcC9PFGGGqARc8lR9t/QlmRJIASssB3Q4dKhmEjK+uwKCnACmz1E2yH++ mQFJWyWDCvdmRZbQgzbIFDjJxNzRl+TnuGvQClRTpbZDiNB4o8t6JDTkkuLDvvN+OE 6NOeWUCD05UHfY5cw5lGV9UEYz4qDnESis6u7yBZ2djBgHEi3AObxBKRtyjD0SDu2j aWA/dW27t3FGA== From: SJ Park To: Andrew Morton Cc: Enze Li , SJ Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 7/7] samples/damon/mtier: add comment for struct region_range Date: Mon, 31 Aug 2026 07:26:09 -0700 Message-ID: <20260831142611.77572-8-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260831142611.77572-1-sj@kernel.org> References: <20260831142611.77572-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" From: Enze Li The mtier sample defines a local struct region_range using phys_addr_t instead of damon_addr_range which uses unsigned long. Add a comment explaining the rationale: on 32-bit systems with more than 4GiB memory, phys_addr_t will be 64-bit while unsigned long is 32-bit. Signed-off-by: Enze Li Reviewed-by: SJ Park Signed-off-by: SJ Park --- Changes from v1 - v1: https://lore.kernel.org/20260721070756.54435-1-lienze@kylinos.cn - Collect R-b: from SJ. - Rebase to latest mm-new. samples/damon/mtier.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c index d1123ebbfab90..bea45c87cc9be 100644 --- a/samples/damon/mtier.c +++ b/samples/damon/mtier.c @@ -52,6 +52,11 @@ module_param(detect_node_addresses, bool, 0600); =20 static struct damon_ctx *ctxs[2]; =20 +/* + * Use phys_addr_t instead of damon_addr_range (unsigned long) for physical + * addresses. On 32-bit systems with more than 4GB memory, phys_addr_t wi= ll + * be 64-bit while unsigned long is 32-bit. + */ struct region_range { phys_addr_t start; phys_addr_t end; --=20 2.47.3