Skip to contentSkip to conversation

mm-damon-sysfs-dont-hold-kdamond_lock-in-before_terminate.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jul 20, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/damon/sysfs: don't hold kdamond_lock in before_terminate()
has been removed from the -mm tree. Its filename was
mm-damon-sysfs-dont-hold-kdamond_lock-in-before_terminate.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/sysfs: don't hold kdamond_lock in before_terminate()
Date: Sat, 5 Jul 2025 10:49:59 -0700

damon_sysfs_before_terminate() is a DAMON callback that is executed from the kdamond's context. Hence it is safe to access DAMON context internal data. But the function is unnecessarily holding kdamond_lock of the context. It is just unnecessary. Remove the locking code.

---

 mm/damon/sysfs.c |    2 --
 1 file changed, 2 deletions(-)
mm/damon/sysfs.c renamed from mm/damon/sysfs.c~mm-damon-sysfs-dont-hold-kdamond_lock-in-before_terminate +0 -2
@@ -1387,12 +1387,10 @@ static void damon_sysfs_before_terminate
 	if (!damon_target_has_pid(ctx))
 		return;
 
-	mutex_lock(&ctx->kdamond_lock);
 	damon_for_each_target_safe(t, next, ctx) {
 		put_pid(t->pid);
 		damon_destroy_target(t);
 	}
-	mutex_unlock(&ctx->kdamond_lock);
 }
 
 /*

_

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

mm-damon-core-commit-damos_quota_goal-nid.patch mm-damon-sysfs-implement-refresh_ms-file-under-kdamond-directory.patch mm-damon-sysfs-implement-refresh_ms-file-internal-work.patch docs-admin-guide-mm-damon-usage-document-refresh_ms-file.patch docs-abi-damon-update-for-refresh_ms.patch