Skip to contentSkip to conversation

mm-damon-core-add-damon_nr_regions-debug_sanity-check.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Mar 29

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/damon/core: add damon_nr_regions() debug_sanity check
has been removed from the -mm tree. Its filename was
mm-damon-core-add-damon_nr_regions-debug_sanity-check.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: SeongJae Park <[email protected]>
Subject: mm/damon/core: add damon_nr_regions() debug_sanity check
Date: Fri, 6 Mar 2026 07:29:07 -0800

damon_target->nr_regions is introduced to get the number quickly without having to iterate regions always. Add a sanity check for that under CONFIG_DAMON_DEBUG_SANITY.

---

 mm/damon/core.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
mm/damon/core.c renamed from mm/damon/core.c~mm-damon-core-add-damon_nr_regions-debug_sanity-check +19 -0
@@ -545,8 +545,27 @@ void damon_destroy_target(struct damon_t
 	damon_free_target(t);
 }
 
+#ifdef CONFIG_DAMON_DEBUG_SANITY
+static void damon_verify_nr_regions(struct damon_target *t)
+{
+	struct damon_region *r;
+	unsigned int count = 0;
+
+	damon_for_each_region(r, t)
+		count++;
+	WARN_ONCE(count != t->nr_regions, "t->nr_regions (%u) != count (%u)\n",
+			t->nr_regions, count);
+}
+#else
+static void damon_verify_nr_regions(struct damon_target *t)
+{
+}
+#endif
+
 unsigned int damon_nr_regions(struct damon_target *t)
 {
+	damon_verify_nr_regions(t);
+
 	return t->nr_regions;
 }
 

_

Patches currently in -mm which might be from [email protected] are

mm-damon-sysfs-dealloc-repeat_call_control-if-damon_call-fails.patch