From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,zhaozhengzhuo@uniontech.com,zenghui.yu@linux.dev,sj@kernel.org,shuah@kernel.org,liyouhong@kylinos.cn,lienze@kylinos.cn,harimishal1@gmail.com,gregkh@linuxfoundation.org,jaeyeon.lee.dev@gmail.com,akpm@linux-foundation.org
Subject: [merged mm-stable] mm-damon-tests-use-scoped_guard-for-damon_test_ops_registration.patch removed from -mm tree
Date: Tue, 06 Oct 2026 17:51:27 -0700 [thread overview]
Message-ID: <20261007005128.4C9561F0089C@smtp.kernel.org> (raw)
The quilt patch titled
Subject: mm/damon/tests: use scoped_guard() for damon_test_ops_registration
has been removed from the -mm tree. Its filename was
mm-damon-tests-use-scoped_guard-for-damon_test_ops_registration.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: Jaeyeon Lee <jaeyeon.lee.dev@gmail.com>
Subject: mm/damon/tests: use scoped_guard() for damon_test_ops_registration
Date: Mon, 31 Aug 2026 07:26:07 -0700
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.
Link: https://lore.kernel.org/20260831142611.77572-6-sj@kernel.org
Signed-off-by: Jaeyeon Lee <jaeyeon.lee.dev@gmail.com>
Signed-off-by: SJ Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: SJ Park <sj@kernel.org>
Cc: Enze Li <lienze@kylinos.cn>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hari Mishal <harimishal1@gmail.com>
Cc: Li Youhong <liyouhong@kylinos.cn>
Cc: Shuah Khan <shuah@kernel.org>
Cc: "Zenghui Yu (Huawei)" <zenghui.yu@linux.dev>
Cc: zhaozhengzhuo <zhaozhengzhuo@uniontech.com>
---
mm/damon/tests/core-kunit.h | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
--- a/mm/damon/tests/core-kunit.h~mm-damon-tests-use-scoped_guard-for-damon_test_ops_registration
+++ a/mm/damon/tests/core-kunit.h
@@ -441,17 +441,17 @@ static void damon_test_ops_registration(
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);
@@ -459,10 +459,9 @@ static void damon_test_ops_registration(
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){};
}
}
_
Patches currently in -mm which might be from jaeyeon.lee.dev@gmail.com are
selftests-mm-skip-khugepaged-file-tests-if-mkfsxfs-is-unavailable.patch
selftests-mm-hugetlb-read-hwpoison-add-setup-of-hugetlb-pages.patch
selftests-mm-hugetlb_madv_vs_map-fix-tap-plan-mismatches.patch
reply other threads:[~2026-10-07 0:51 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=20261007005128.4C9561F0089C@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=harimishal1@gmail.com \
--cc=jaeyeon.lee.dev@gmail.com \
--cc=lienze@kylinos.cn \
--cc=liyouhong@kylinos.cn \
--cc=mm-commits@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=sj@kernel.org \
--cc=zenghui.yu@linux.dev \
--cc=zhaozhengzhuo@uniontech.com \
/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.