From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,shuah@kernel.org,davidgow@google.com,brendan.higgins@linux.dev,sj@kernel.org,akpm@linux-foundation.org
Subject: [merged mm-stable] mm-damon-core-add-damon_merge_two_regions-debug_sanity-check.patch removed from -mm tree
Date: Sat, 28 Mar 2026 17:40:21 -0700 [thread overview]
Message-ID: <20260329004022.108BFC4CEF7@smtp.kernel.org> (raw)
The quilt patch titled
Subject: mm/damon/core: add damon_merge_two_regions() debug_sanity check
has been removed from the -mm tree. Its filename was
mm-damon-core-add-damon_merge_two_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 <sj@kernel.org>
Subject: mm/damon/core: add damon_merge_two_regions() debug_sanity check
Date: Fri, 6 Mar 2026 07:29:08 -0800
A data corruption could cause damon_merge_two_regions() creating zero
length DAMON regions. Add a sanity check for that under
CONFIG_DAMON_DEBUG_SANITY.
Link: https://lkml.kernel.org/r/20260306152914.86303-6-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/damon/core.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--- a/mm/damon/core.c~mm-damon-core-add-damon_merge_two_regions-debug_sanity-check
+++ a/mm/damon/core.c
@@ -2475,6 +2475,21 @@ static void kdamond_apply_schemes(struct
mutex_unlock(&c->walk_control_lock);
}
+#ifdef CONFIG_DAMON_DEBUG_SANITY
+static void damon_verify_merge_two_regions(
+ struct damon_region *l, struct damon_region *r)
+{
+ /* damon_merge_two_regions() may created incorrect left region */
+ WARN_ONCE(l->ar.start >= l->ar.end, "l: %lu-%lu, r: %lu-%lu\n",
+ l->ar.start, l->ar.end, r->ar.start, r->ar.end);
+}
+#else
+static void damon_verify_merge_two_regions(
+ struct damon_region *l, struct damon_region *r)
+{
+}
+#endif
+
/*
* Merge two adjacent regions into one region
*/
@@ -2488,6 +2503,7 @@ static void damon_merge_two_regions(stru
l->nr_accesses_bp = l->nr_accesses * 10000;
l->age = (l->age * sz_l + r->age * sz_r) / (sz_l + sz_r);
l->ar.end = r->ar.end;
+ damon_verify_merge_two_regions(l, r);
damon_destroy_region(r, t);
}
_
Patches currently in -mm which might be from sj@kernel.org are
mm-damon-sysfs-dealloc-repeat_call_control-if-damon_call-fails.patch
reply other threads:[~2026-03-29 0:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260329004022.108BFC4CEF7@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=brendan.higgins@linux.dev \
--cc=davidgow@google.com \
--cc=mm-commits@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=sj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.