Skip to contentSkip to conversation

mm-damon-core-document-damon_call-damon_start-race-hang-issue.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 13

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/damon/core: document damon_call()/damon_start() race hang issue
has been removed from the -mm tree. Its filename was
mm-damon-core-document-damon_call-damon_start-race-hang-issue.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: SJ Park <[email protected]>
Subject: mm/damon/core: document damon_call()/damon_start() race hang issue
Date: Thu, 17 Sep 2026 07:22:03 -0700

Let's suppose damon_start() and damon_call() are executed in parallel for the same DAMON context. Then, damon_call() could show ctx->damon_calls_obsolete set while ctx->kdamond is unset. If damon_start() sets ctx->kdamond before damon_call() starts the cancelling, damon_call() can indefinitely hang. No DAMON API caller does such parallel execution of damon_start() and damon_call(), so the issue doesn't exist. But who knows what will happen in future. Add a clarification comment for caution.

Cc Asier Gutierrez <[email protected]>
Cc Brendan Higgins <[email protected]>
Cc David Gow <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 mm/damon/core.c |    3 +++
 1 file changed, 3 insertions(+)
mm/damon/core.c renamed from mm/damon/core.c~mm-damon-core-document-damon_call-damon_start-race-hang-issue +3 -0
@@ -2258,6 +2258,9 @@ int damon_kdamond_pid(struct damon_ctx *
  *
  * When this function is failed, the @ctx is guaranteed to be stopped.
  *
+ * This function should not be called in parallel to damon_start() for the
+ * @ctx.  In the case, this function could indefinitely hang.
+ *
  * Return: 0 on success, negative error code otherwise.
  */
 int damon_call(struct damon_ctx *ctx, struct damon_call_control *control)

_

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

mm-damon-core-introduce-damos_quota_goal-complement.patch mm-damon-core-add-complement-argument-to-damos_new_quota_goal.patch mm-damon-sysfs-schemes-support-quota-goal-complement-flag.patch mm-damon-tests-core-kunit-test-quota_goal-complement-commit.patch selftests-damon-sysfssh-test-quota-goal-complement-flag-file.patch docs-mm-damon-design-document-damos-quota-goal-complement-flag.patch docs-admin-guide-mm-damon-usage-update-for-quota-goal-complement-file.patch docs-abi-damon-update-for-quota-goal-metric-complement-sysfs-file.patch