| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/08/31 21:35 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch series consists purely of non-functional refactoring, code deduplication, test cleanups, and selftest fixes. Specifically: it extracts a helper function (damon_set_target_pid) to assign the PID of a target, deduplicates page putback code into a static helper (damon_putback_folio_list) without altering behavior, converts mutex locking to scoped_guard in KUnit tests, updates sample modules to use the new helper, and fixes Python mutable default arguments in selftests. No functional or algorithmic changes are introduced that warrant fuzzing.",
"WorthFuzzing": false
} |
| 1/1 | 2026/08/31 21:35 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 88d764f2b86cd853a4f68e22a124dd830672e7af\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Mon Aug 31 21:35:14 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/include/linux/damon.h b/include/linux/damon.h\nindex 0c8b7ddef9abb..5607f98ec6306 100644\n--- a/include/linux/damon.h\n+++ b/include/linux/damon.h\n@@ -1055,6 +1055,7 @@ int damos_commit_quota_goals(struct damos_quota *dst, struct damos_quota *src);\n struct damon_target *damon_new_target(void);\n void damon_add_target(struct damon_ctx *ctx, struct damon_target *t);\n bool damon_targets_empty(struct damon_ctx *ctx);\n+int damon_set_target_pid(struct damon_target *t, int pid);\n void damon_free_target(struct damon_target *t);\n void damon_destroy_target(struct damon_target *t, struct damon_ctx *ctx);\n unsigned int damon_nr_regions(struct damon_target *t);\ndiff --git a/mm/damon/core.c b/mm/damon/core.c\nindex 644daf5a16560..de93e9948e2ed 100644\n--- a/mm/damon/core.c\n+++ b/mm/damon/core.c\n@@ -10,6 +10,7 @@\n #include \u003clinux/kthread.h\u003e\n #include \u003clinux/memcontrol.h\u003e\n #include \u003clinux/mm.h\u003e\n+#include \u003clinux/pid.h\u003e\n #include \u003clinux/psi.h\u003e\n #include \u003clinux/sched.h\u003e\n #include \u003clinux/slab.h\u003e\n@@ -800,6 +801,17 @@ bool damon_targets_empty(struct damon_ctx *ctx)\n \treturn list_empty(\u0026ctx-\u003eadaptive_targets);\n }\n \n+/*\n+ * Assign the struct pid of the given pid number to the given target.\n+ */\n+int damon_set_target_pid(struct damon_target *t, int pid)\n+{\n+\tt-\u003epid = find_get_pid(pid);\n+\tif (!t-\u003epid)\n+\t\treturn -EINVAL;\n+\treturn 0;\n+}\n+\n static void damon_del_target(struct damon_target *t)\n {\n \tlist_del(\u0026t-\u003elist);\n@@ -1954,8 +1966,6 @@ static int __damon_start(struct damon_ctx *ctx)\n \treturn err;\n }\n \n-static int __damon_commit_ctx(struct damon_ctx *dst, struct damon_ctx *src);\n-\n /**\n * damon_start() - Starts the monitorings for a given group of contexts.\n * @ctxs:\tan array of the pointers for contexts to start monitoring\ndiff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c\nindex fbda70d8ea4d0..7a2e40bc7baed 100644\n--- a/mm/damon/ops-common.c\n+++ b/mm/damon/ops-common.c\n@@ -330,6 +330,19 @@ static unsigned int __damon_migrate_folio_list(\n \treturn nr_succeeded;\n }\n \n+static void damon_putback_folio_list(struct list_head *folio_list)\n+{\n+\tstruct folio *folio;\n+\n+\twhile (!list_empty(folio_list)) {\n+\t\tfolio = lru_to_folio(folio_list);\n+\t\tlist_del(\u0026folio-\u003elru);\n+\t\tnode_stat_sub_folio(folio, NR_ISOLATED_ANON +\n+\t\t\t\tfolio_is_file_lru(folio));\n+\t\tfolio_putback_lru(folio);\n+\t}\n+}\n+\n static unsigned int damon_migrate_folio_list(struct list_head *folio_list,\n \t\t\t\t\t\tstruct pglist_data *pgdat,\n \t\t\t\t\t\tint target_nid)\n@@ -371,13 +384,7 @@ static unsigned int damon_migrate_folio_list(struct list_head *folio_list,\n \n \tlist_splice(\u0026ret_folios, folio_list);\n \n-\twhile (!list_empty(folio_list)) {\n-\t\tfolio = lru_to_folio(folio_list);\n-\t\tlist_del(\u0026folio-\u003elru);\n-\t\tnode_stat_sub_folio(folio, NR_ISOLATED_ANON +\n-\t\t\t\tfolio_is_file_lru(folio));\n-\t\tfolio_putback_lru(folio);\n-\t}\n+\tdamon_putback_folio_list(folio_list);\n \n \treturn nr_migrated;\n }\n@@ -394,14 +401,7 @@ unsigned long damon_migrate_pages(struct list_head *folio_list, int target_nid)\n \n \tif (target_nid \u003c 0 || target_nid \u003e= MAX_NUMNODES ||\n \t\t\t!node_state(target_nid, N_MEMORY)) {\n-\t\twhile (!list_empty(folio_list)) {\n-\t\t\tstruct folio *folio = lru_to_folio(folio_list);\n-\n-\t\t\tlist_del(\u0026folio-\u003elru);\n-\t\t\tnode_stat_sub_folio(folio, NR_ISOLATED_ANON +\n-\t\t\t\t\tfolio_is_file_lru(folio));\n-\t\t\tfolio_putback_lru(folio);\n-\t\t}\n+\t\tdamon_putback_folio_list(folio_list);\n \t\treturn nr_migrated;\n \t}\n \ndiff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c\nindex e3858ffab4b22..3c81b4c91ac0d 100644\n--- a/mm/damon/sysfs.c\n+++ b/mm/damon/sysfs.c\n@@ -3,7 +3,6 @@\n * DAMON sysfs Interface\n */\n \n-#include \u003clinux/pid.h\u003e\n #include \u003clinux/sched.h\u003e\n #include \u003clinux/slab.h\u003e\n \n@@ -2035,9 +2034,8 @@ static int damon_sysfs_add_target(struct damon_sysfs_target *sys_target,\n \t\treturn -ENOMEM;\n \tdamon_add_target(ctx, t);\n \tif (damon_target_has_pid(ctx)) {\n-\t\tt-\u003epid = find_get_pid(sys_target-\u003epid);\n-\t\tif (!t-\u003epid)\n-\t\t\t/* caller will destroy targets */\n+\t\t/* caller will destroy targets */\n+\t\tif (damon_set_target_pid(t, sys_target-\u003epid))\n \t\t\treturn -EINVAL;\n \t}\n \tt-\u003eobsolete = sys_target-\u003eobsolete;\ndiff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h\nindex 4a536d41cdb2d..770927a30021c 100644\n--- a/mm/damon/tests/core-kunit.h\n+++ b/mm/damon/tests/core-kunit.h\n@@ -434,17 +434,17 @@ static void damon_test_ops_registration(struct kunit *test)\n \tKUNIT_EXPECT_EQ(test, damon_select_ops(c, NR_DAMON_OPS), -EINVAL);\n \n \t/* Registration should success after unregistration */\n-\tmutex_lock(\u0026damon_ops_lock);\n-\tbak = damon_registered_ops[DAMON_OPS_VADDR];\n-\tdamon_registered_ops[DAMON_OPS_VADDR] = (struct damon_operations){};\n-\tmutex_unlock(\u0026damon_ops_lock);\n+\tscoped_guard(mutex, \u0026damon_ops_lock) {\n+\t\tbak = damon_registered_ops[DAMON_OPS_VADDR];\n+\t\tdamon_registered_ops[DAMON_OPS_VADDR] =\n+\t\t\t(struct damon_operations){};\n+\t}\n \n \tops.id = DAMON_OPS_VADDR;\n \tKUNIT_EXPECT_EQ(test, damon_register_ops(\u0026ops), 0);\n \n-\tmutex_lock(\u0026damon_ops_lock);\n-\tdamon_registered_ops[DAMON_OPS_VADDR] = bak;\n-\tmutex_unlock(\u0026damon_ops_lock);\n+\tscoped_guard(mutex, \u0026damon_ops_lock)\n+\t\tdamon_registered_ops[DAMON_OPS_VADDR] = bak;\n \n \t/* Check double-registration failure again */\n \tKUNIT_EXPECT_EQ(test, damon_register_ops(\u0026ops), -EINVAL);\n@@ -452,10 +452,9 @@ static void damon_test_ops_registration(struct kunit *test)\n \tdamon_destroy_ctx(c);\n \n \tif (need_cleanup) {\n-\t\tmutex_lock(\u0026damon_ops_lock);\n-\t\tdamon_registered_ops[DAMON_OPS_VADDR] =\n-\t\t\t(struct damon_operations){};\n-\t\tmutex_unlock(\u0026damon_ops_lock);\n+\t\tscoped_guard(mutex, \u0026damon_ops_lock)\n+\t\t\tdamon_registered_ops[DAMON_OPS_VADDR] =\n+\t\t\t\t(struct damon_operations){};\n \t}\n }\n \ndiff --git a/samples/damon/mtier.c b/samples/damon/mtier.c\nindex d1123ebbfab90..bea45c87cc9be 100644\n--- a/samples/damon/mtier.c\n+++ b/samples/damon/mtier.c\n@@ -52,6 +52,11 @@ module_param(detect_node_addresses, bool, 0600);\n \n static struct damon_ctx *ctxs[2];\n \n+/*\n+ * Use phys_addr_t instead of damon_addr_range (unsigned long) for physical\n+ * addresses. On 32-bit systems with more than 4GB memory, phys_addr_t will\n+ * be 64-bit while unsigned long is 32-bit.\n+ */\n struct region_range {\n \tphys_addr_t start;\n \tphys_addr_t end;\ndiff --git a/samples/damon/prcl.c b/samples/damon/prcl.c\nindex 842099bd62286..83ddf12811d57 100644\n--- a/samples/damon/prcl.c\n+++ b/samples/damon/prcl.c\n@@ -32,7 +32,6 @@ module_param_cb(enabled, \u0026enabled_param_ops, \u0026enabled, 0600);\n MODULE_PARM_DESC(enabled, \"Enable or disable DAMON_SAMPLE_PRCL\");\n \n static struct damon_ctx *ctx;\n-static struct pid *target_pidp;\n \n static int damon_sample_prcl_repeat_call_fn(void *data)\n {\n@@ -79,12 +78,10 @@ static int damon_sample_prcl_start(void)\n \t\treturn -ENOMEM;\n \t}\n \tdamon_add_target(ctx, target);\n-\ttarget_pidp = find_get_pid(target_pid);\n-\tif (!target_pidp) {\n+\tif (damon_set_target_pid(target, target_pid)) {\n \t\tdamon_destroy_ctx(ctx);\n \t\treturn -EINVAL;\n \t}\n-\ttarget-\u003epid = target_pidp;\n \n \tscheme = damon_new_scheme(\n \t\t\t\u0026(struct damos_access_pattern) {\ndiff --git a/samples/damon/wsse.c b/samples/damon/wsse.c\nindex 37fd5da201588..53944aea8428e 100644\n--- a/samples/damon/wsse.c\n+++ b/samples/damon/wsse.c\n@@ -33,7 +33,6 @@ module_param_cb(enabled, \u0026enabled_param_ops, \u0026enabled, 0600);\n MODULE_PARM_DESC(enabled, \"Enable or disable DAMON_SAMPLE_WSSE\");\n \n static struct damon_ctx *ctx;\n-static struct pid *target_pidp;\n \n static int damon_sample_wsse_repeat_call_fn(void *data)\n {\n@@ -79,12 +78,10 @@ static int damon_sample_wsse_start(void)\n \t\treturn -ENOMEM;\n \t}\n \tdamon_add_target(ctx, target);\n-\ttarget_pidp = find_get_pid(target_pid);\n-\tif (!target_pidp) {\n+\tif (damon_set_target_pid(target, target_pid)) {\n \t\tdamon_destroy_ctx(ctx);\n \t\treturn -EINVAL;\n \t}\n-\ttarget-\u003epid = target_pidp;\n \n \terr = damon_start(\u0026ctx, 1, true);\n \tif (err) {\ndiff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py\nindex e6a2265d721e8..f604b7d6530b3 100644\n--- a/tools/testing/selftests/damon/_damon_sysfs.py\n+++ b/tools/testing/selftests/damon/_damon_sysfs.py\n@@ -321,8 +321,10 @@ class DamosFilters:\n filters = None\n scheme = None # owner scheme\n \n- def __init__(self, name, filters=[]):\n+ def __init__(self, name, filters=None):\n self.name = name\n+ if filters is None:\n+ filters = []\n self.filters = filters\n for idx, filter_ in enumerate(self.filters):\n filter_.idx = idx\n@@ -368,7 +370,9 @@ class DamosDests:\n dests = None\n scheme = None # owner scheme\n \n- def __init__(self, dests=[]):\n+ def __init__(self, dests=None):\n+ if dests is None:\n+ dests = []\n self.dests = dests\n for idx, dest in enumerate(self.dests):\n dest.idx = idx\n@@ -426,15 +430,21 @@ class Damos:\n stats = None\n tried_regions = None\n \n- def __init__(self, action='stat', access_pattern=DamosAccessPattern(),\n- quota=DamosQuota(), watermarks=DamosWatermarks(),\n- core_filters=[], ops_filters=[], filters=[], target_nid=0,\n- dests=DamosDests(), apply_interval_us=0):\n+ def __init__(self, action='stat', access_pattern=None, quota=None,\n+ watermarks=None, core_filters=None, ops_filters=None,\n+ filters=None, target_nid=0, dests=None,\n+ apply_interval_us=0):\n self.action = action\n+ if access_pattern is None:\n+ access_pattern = DamosAccessPattern()\n self.access_pattern = access_pattern\n self.access_pattern.scheme = self\n+ if quota is None:\n+ quota = DamosQuota()\n self.quota = quota\n self.quota.scheme = self\n+ if watermarks is None:\n+ watermarks = DamosWatermarks()\n self.watermarks = watermarks\n self.watermarks.scheme = self\n \n@@ -448,6 +458,8 @@ class Damos:\n self.filters.scheme = self\n \n self.target_nid = target_nid\n+ if dests is None:\n+ dests = DamosDests()\n self.dests = dests\n self.dests.scheme = self\n \n@@ -568,10 +580,12 @@ class DamonAttrs:\n context = None\n \n def __init__(self, sample_us=5000, aggr_us=100000,\n- intervals_goal=IntervalsGoal(), update_us=1000000,\n- min_nr_regions=10, max_nr_regions=1000):\n+ intervals_goal=None, update_us=1000000, min_nr_regions=10,\n+ max_nr_regions=1000):\n self.sample_us = sample_us\n self.aggr_us = aggr_us\n+ if intervals_goal is None:\n+ intervals_goal = IntervalsGoal()\n self.intervals_goal = intervals_goal\n self.intervals_goal.attrs = self\n self.update_us = update_us\n@@ -703,7 +717,9 @@ class Kdamond:\n idx = None # index of this kdamond between siblings\n kdamonds = None # parent\n \n- def __init__(self, contexts=[], refresh_ms=None):\n+ def __init__(self, contexts=None, refresh_ms=None):\n+ if contexts is None:\n+ contexts = []\n self.contexts = contexts\n self.refresh_ms = refresh_ms\n for idx, context in enumerate(self.contexts):\n@@ -853,7 +869,9 @@ class Kdamond:\n class Kdamonds:\n kdamonds = []\n \n- def __init__(self, kdamonds=[]):\n+ def __init__(self, kdamonds=None):\n+ if kdamonds is None:\n+ kdamonds = []\n self.kdamonds = kdamonds\n for idx, kdamond in enumerate(self.kdamonds):\n kdamond.idx = idx\ndiff --git a/tools/testing/selftests/damon/sysfs.py b/tools/testing/selftests/damon/sysfs.py\nindex 3ffa054b63867..88a26422ff44c 100755\n--- a/tools/testing/selftests/damon/sysfs.py\n+++ b/tools/testing/selftests/damon/sysfs.py\n@@ -385,6 +385,10 @@ def main():\n assert_ctxs_committed(kdamonds)\n kdamonds.stop()\n \n+ for proc in (proc1, proc2, proc3):\n+ proc.terminate()\n+ proc.communicate()\n+\n test_memcg_filter_memcg_path_staging()\n \n if __name__ == '__main__':\n"
} |
| 2/1 | 2026/08/31 21:35 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch series consists purely of non-functional refactoring, code deduplication, test cleanups, and selftest fixes. Specifically: it extracts a helper function (damon_set_target_pid) to assign the PID of a target, deduplicates page putback code into a static helper (damon_putback_folio_list) without altering behavior, converts mutex locking to scoped_guard in KUnit tests, updates sample modules to use the new helper, and fixes Python mutable default arguments in selftests. No functional or algorithmic changes are introduced that warrant fuzzing.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 88d764f2b86cd853a4f68e22a124dd830672e7af
Author: syz-cluster <triage@syzkaller.com>
Date: Mon Aug 31 21:35:14 2026 +0000
syz-cluster: applied patch under review
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 644daf5a16560..de93e9948e2ed 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -10,6 +10,7 @@
#include <linux/kthread.h>
#include <linux/memcontrol.h>
#include <linux/mm.h>
+#include <linux/pid.h>
#include <linux/psi.h>
#include <linux/sched.h>
#include <linux/slab.h>
@@ -800,6 +801,17 @@ bool damon_targets_empty(struct damon_ctx *ctx)
return list_empty(&ctx->adaptive_targets);
}
+/*
+ * 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 = find_get_pid(pid);
+ if (!t->pid)
+ return -EINVAL;
+ return 0;
+}
+
static void damon_del_target(struct damon_target *t)
{
list_del(&t->list);
@@ -1954,8 +1966,6 @@ static int __damon_start(struct damon_ctx *ctx)
return err;
}
-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
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;
}
+static void damon_putback_folio_list(struct list_head *folio_list)
+{
+ struct folio *folio;
+
+ while (!list_empty(folio_list)) {
+ folio = 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 list_head *folio_list,
list_splice(&ret_folios, folio_list);
- while (!list_empty(folio_list)) {
- folio = 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;
}
@@ -394,14 +401,7 @@ unsigned long damon_migrate_pages(struct list_head *folio_list, int target_nid)
if (target_nid < 0 || target_nid >= MAX_NUMNODES ||
!node_state(target_nid, N_MEMORY)) {
- while (!list_empty(folio_list)) {
- struct folio *folio = 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;
}
diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index e3858ffab4b22..3c81b4c91ac0d 100644
--- a/mm/damon/sysfs.c
+++ b/mm/damon/sysfs.c
@@ -3,7 +3,6 @@
* DAMON sysfs Interface
*/
-#include <linux/pid.h>
#include <linux/sched.h>
#include <linux/slab.h>
@@ -2035,9 +2034,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 = 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 = sys_target->obsolete;
diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
index 4a536d41cdb2d..770927a30021c 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);
/* Registration should success after unregistration */
- mutex_lock(&damon_ops_lock);
- bak = damon_registered_ops[DAMON_OPS_VADDR];
- damon_registered_ops[DAMON_OPS_VADDR] = (struct damon_operations){};
- mutex_unlock(&damon_ops_lock);
+ scoped_guard(mutex, &damon_ops_lock) {
+ bak = damon_registered_ops[DAMON_OPS_VADDR];
+ damon_registered_ops[DAMON_OPS_VADDR] =
+ (struct damon_operations){};
+ }
ops.id = DAMON_OPS_VADDR;
KUNIT_EXPECT_EQ(test, damon_register_ops(&ops), 0);
- mutex_lock(&damon_ops_lock);
- damon_registered_ops[DAMON_OPS_VADDR] = bak;
- mutex_unlock(&damon_ops_lock);
+ scoped_guard(mutex, &damon_ops_lock)
+ damon_registered_ops[DAMON_OPS_VADDR] = bak;
/* 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);
if (need_cleanup) {
- mutex_lock(&damon_ops_lock);
- damon_registered_ops[DAMON_OPS_VADDR] =
- (struct damon_operations){};
- mutex_unlock(&damon_ops_lock);
+ scoped_guard(mutex, &damon_ops_lock)
+ damon_registered_ops[DAMON_OPS_VADDR] =
+ (struct damon_operations){};
}
}
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);
static struct damon_ctx *ctxs[2];
+/*
+ * 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 will
+ * be 64-bit while unsigned long is 32-bit.
+ */
struct region_range {
phys_addr_t start;
phys_addr_t end;
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, 0600);
MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_PRCL");
static struct damon_ctx *ctx;
-static struct pid *target_pidp;
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 = find_get_pid(target_pid);
- if (!target_pidp) {
+ if (damon_set_target_pid(target, target_pid)) {
damon_destroy_ctx(ctx);
return -EINVAL;
}
- target->pid = target_pidp;
scheme = 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, 0600);
MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_WSSE");
static struct damon_ctx *ctx;
-static struct pid *target_pidp;
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 = find_get_pid(target_pid);
- if (!target_pidp) {
+ if (damon_set_target_pid(target, target_pid)) {
damon_destroy_ctx(ctx);
return -EINVAL;
}
- target->pid = target_pidp;
err = damon_start(&ctx, 1, true);
if (err) {
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 = None
scheme = None # owner scheme
- def __init__(self, name, filters=[]):
+ def __init__(self, name, filters=None):
self.name = name
+ if filters is None:
+ filters = []
self.filters = filters
for idx, filter_ in enumerate(self.filters):
filter_.idx = idx
@@ -368,7 +370,9 @@ class DamosDests:
dests = None
scheme = None # owner scheme
- def __init__(self, dests=[]):
+ def __init__(self, dests=None):
+ if dests is None:
+ dests = []
self.dests = dests
for idx, dest in enumerate(self.dests):
dest.idx = idx
@@ -426,15 +430,21 @@ class Damos:
stats = None
tried_regions = None
- def __init__(self, action='stat', access_pattern=DamosAccessPattern(),
- quota=DamosQuota(), watermarks=DamosWatermarks(),
- core_filters=[], ops_filters=[], filters=[], target_nid=0,
- dests=DamosDests(), apply_interval_us=0):
+ def __init__(self, action='stat', access_pattern=None, quota=None,
+ watermarks=None, core_filters=None, ops_filters=None,
+ filters=None, target_nid=0, dests=None,
+ apply_interval_us=0):
self.action = action
+ if access_pattern is None:
+ access_pattern = DamosAccessPattern()
self.access_pattern = access_pattern
self.access_pattern.scheme = self
+ if quota is None:
+ quota = DamosQuota()
self.quota = quota
self.quota.scheme = self
+ if watermarks is None:
+ watermarks = DamosWatermarks()
self.watermarks = watermarks
self.watermarks.scheme = self
@@ -448,6 +458,8 @@ class Damos:
self.filters.scheme = self
self.target_nid = target_nid
+ if dests is None:
+ dests = DamosDests()
self.dests = dests
self.dests.scheme = self
@@ -568,10 +580,12 @@ class DamonAttrs:
context = None
def __init__(self, sample_us=5000, aggr_us=100000,
- intervals_goal=IntervalsGoal(), update_us=1000000,
- min_nr_regions=10, max_nr_regions=1000):
+ intervals_goal=None, update_us=1000000, min_nr_regions=10,
+ max_nr_regions=1000):
self.sample_us = sample_us
self.aggr_us = aggr_us
+ if intervals_goal is None:
+ intervals_goal = IntervalsGoal()
self.intervals_goal = intervals_goal
self.intervals_goal.attrs = self
self.update_us = update_us
@@ -703,7 +717,9 @@ class Kdamond:
idx = None # index of this kdamond between siblings
kdamonds = None # parent
- def __init__(self, contexts=[], refresh_ms=None):
+ def __init__(self, contexts=None, refresh_ms=None):
+ if contexts is None:
+ contexts = []
self.contexts = contexts
self.refresh_ms = refresh_ms
for idx, context in enumerate(self.contexts):
@@ -853,7 +869,9 @@ class Kdamond:
class Kdamonds:
kdamonds = []
- def __init__(self, kdamonds=[]):
+ def __init__(self, kdamonds=None):
+ if kdamonds is None:
+ kdamonds = []
self.kdamonds = kdamonds
for idx, kdamond in enumerate(self.kdamonds):
kdamond.idx = idx
diff --git a/tools/testing/selftests/damon/sysfs.py b/tools/testing/selftests/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()
+ for proc in (proc1, proc2, proc3):
+ proc.terminate()
+ proc.communicate()
+
test_memcg_filter_memcg_path_staging()
if __name__ == '__main__':
|
| 3/2 | 2026/08/31 21:35 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 6642 output: 22 thoughts: 2820 Thoughts: **Patch Analysis: DAMON Refactoring - WorthFuzzing Evaluation** Alright, let's break this down. My initial assessment is that this patch series primarily focuses on code cleanup and refactoring within the DAMON subsystem. The core changes involve extracting a helper function for folio putback, creating a wrapper for `find_get_pid`, updating a kunit test, and fixing some selftest scripts. My first inclination, given my experience, is that we're looking at a "WorthFuzzing=false" scenario here. The key is to determine if these changes actually introduce any *functional* modifications to the kernel. Let's delve into this. My focus is on whether there are any logic changes, introduced bugs (highly unlikely), or new code paths to trigger fuzzing. Looking at `damon_set_target_pid`, it's essentially a wrapper around `find_get_pid`. After examining the before/after code, I see this is just cosmetic. The `damon_putback_folio_list` function? Identical code from two different locations factored out as a static helper. No changes in the logic there. The kunit test refactoring with `scoped_guard`? A standard practice in modern kernel development; simply makes the test code clearer and less prone to manual lock management errors. The updates to samples? These simply refactor the use of `find_get_pid` with our new helper. Doesn't change how things *work*. Finally, the fixes to selftests? Python fixes. These are user-space scripts, and any bug in those would affect *testing* the kernel, not *the kernel itself*. Based on this analysis and the syzkaller triage principles, this patch series is pure refactoring, code cleanup, tests, and samples with zero new features, bug fixes, or behavioral/functional logic changes. It is my determination there is zero functional impact worth fuzzing. |
| 4/2 | 2026/08/31 21:35 | tool | grepper |
0mArgs:{
"Expression": "damon_set_target_pid"
}Results: {
"Output": "include/linux/damon.h=1057=bool damon_targets_empty(struct damon_ctx *ctx);\ninclude/linux/damon.h:1058:int damon_set_target_pid(struct damon_target *t, int pid);\ninclude/linux/damon.h-1059-void damon_free_target(struct damon_target *t);\n--\nmm/damon/core.c=799=bool damon_targets_empty(struct damon_ctx *ctx)\n--\nmm/damon/core.c-806- */\nmm/damon/core.c:807:int damon_set_target_pid(struct damon_target *t, int pid)\nmm/damon/core.c-808-{\n--\nmm/damon/sysfs.c=2028=static int damon_sysfs_add_target(struct damon_sysfs_target *sys_target,\n--\nmm/damon/sysfs.c-2037-\t\t/* caller will destroy targets */\nmm/damon/sysfs.c:2038:\t\tif (damon_set_target_pid(t, sys_target-\u003epid))\nmm/damon/sysfs.c-2039-\t\t\treturn -EINVAL;\n--\nsamples/damon/prcl.c=59=static int damon_sample_prcl_start(void)\n--\nsamples/damon/prcl.c-80-\tdamon_add_target(ctx, target);\nsamples/damon/prcl.c:81:\tif (damon_set_target_pid(target, target_pid)) {\nsamples/damon/prcl.c-82-\t\tdamon_destroy_ctx(ctx);\n--\nsamples/damon/wsse.c=60=static int damon_sample_wsse_start(void)\n--\nsamples/damon/wsse.c-80-\tdamon_add_target(ctx, target);\nsamples/damon/wsse.c:81:\tif (damon_set_target_pid(target, target_pid)) {\nsamples/damon/wsse.c-82-\t\tdamon_destroy_ctx(ctx);\n"
} |
| 5/2 | 2026/08/31 21:35 | llm | patch-evaluator |
0mModel:gemini-3.7-flash Args: null Results: null Tokens: input: 10457 output: 150 thoughts: 254 Thoughts: **My Assessment of the Recent Changes** Okay, let's take a quick audit. Before I make any decisions about fuzzing, I need to be absolutely sure there aren't any hidden functional shifts here. Looking at the diff, it seems like the changes are isolated. I see: `include/linux/damon.h`, `mm/damon/core.c`, `mm/damon/ops-common.c`, `mm/damon/sysfs.c`, `mm/damon/tests/core-kunit.h`, `samples/damon/mtier.c`, `samples/damon/prcl.c`, `samples/damon/wsse.c`, `tools/testing/selftests/damon/_damon_sysfs.py`, and `tools/testing/selftests/damon/sysfs.py`. Ah, yes. Purely refactoring: extracting a couple of small helper functions - `damon_set_target_pid` and `damon_putback_folio_list` - and no semantic changes. I spot KUnit test modernization, the usual sample code updates, and some selftest script fixes, too. Given the scope of the edits, there's no functional change here. Nothing new to fuzz in any meaningful way. Time to call it. I'm going to set `WorthFuzzing` to `false`. |
| 6/2 | 2026/08/31 21:35 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch series consists purely of non-functional refactoring, code deduplication, test cleanups, and selftest fixes. Specifically: it extracts a helper function (damon_set_target_pid) to assign the PID of a target, deduplicates page putback code into a static helper (damon_putback_folio_list) without altering behavior, converts mutex locking to scoped_guard in KUnit tests, updates sample modules to use the new helper, and fixes Python mutable default arguments in selftests. No functional or algorithmic changes are introduced that warrant fuzzing.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch series consists purely of non-functional refactoring, code deduplication, test cleanups, and selftest fixes. Specifically: it extracts a helper function (damon_set_target_pid) to assign the PID of a target, deduplicates page putback code into a static helper (damon_putback_folio_list) without altering behavior, converts mutex locking to scoped_guard in KUnit tests, updates sample modules to use the new helper, and fixes Python mutable default arguments in selftests. No functional or algorithmic changes are introduced that warrant fuzzing.",
"WorthFuzzing": false
} |
| 7/1 | 2026/08/31 21:35 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|