From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796183268; b=MMb9IHCB+hI+pIvm+7UGc4BnSYKl6FJTuiqdYeUZYMOaVqDmaYzMBrJHREejcG6VSmS3 87E0qPif/vCHvvyQTGGtuP2kdYHDKz1VrGzbIO8JVd3UGh3Pnej7g67vj4KKLhwHazjJu MorP0JJNcSxs6i2fSmzNH7n/074L0VX4wC4F5eZ3BPj5tlxik2fActDi79zWgtkCV8/qh NvVapVEjos8l5Ipd68/gIQSIOkyOp6rVdTcpYZSdiqXA7B/DXrOadk1Ip7qqHKbWgGBSy GI1F+2BPyIZLQ0ht3pRSwd3gBHPleoX38FLAUYSSk6lgrWHUM1sCzosp2LgVdDOnOMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796183268; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=4m3c99zjvjjN6zTLOmEEnPnn35wNxMm4FKHKdC2iPbE=; b=opvEChGbaR6Op7X7EwvBEVOFBV9zFMYZQGKBUyrkcekaN9cdfpjHE5xjWStPpDbIrHMC KhCeNORUqXbkpruVXsMcvuHv+IOw9yOp0WK19k4MVENZXGNnwTHRVQX/g2gWas99+wF+U aBWXWHp4ogCimnR4H7DHTeZpDHZcFSUVNdHhmb8dFwXhKothVPfm9tjJRxtGY0gLB1Z7N FWBHAOBjU61spF2sVMKdp3/jOaop2vf6KgxWiSD7XrlYH7U0NlMurlzrSK+/4KMZQwycs RgoY39i8Rq1mLp9qRBJfgZXlNAZvCjtaS50e2bOnSP25jyQ7IRYl9yEfIfUPs95LvLA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=msm7J2p1; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43E84606A31A; Wed, 2 Dec 2026 03:47:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=msm7J2p1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0EC01F00893; Wed, 2 Dec 2026 03:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796183268; bh=4m3c99zjvjjN6zTLOmEEnPnn35wNxMm4FKHKdC2iPbE=; h=Date:To:From:In-Reply-To:References:Subject; b=msm7J2p1+y5ZEWdKOsOICRUVDhVfWKsPd1QCi0KZTEWs9bwYaWQUnyleUqs5IIuf9 7CCRerAiJ3fzbdjK/x9m+liTBPcqgsozujeVnYfQ2dcy8d2wVYhw1nLIhSX7qKw8KS o0/T3VsYKB377aTw4BTvhoAnuSgah04ep9UcXbPo= Date: Tue, 01 Dec 2026 19:47:47 -0800 To: mm-commits@vger.kernel.org,stable@vger.kernel.org,sj@kernel.org, devnexen@gmail.com,evanfengff@gmail.com,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261123150049.81317-3-sj@kernel.org> References: <20261123150049.81317-3-sj@kernel.org> Subject: [merged mm-hotfixes-stable] mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval.patch removed from -mm tree Message-Id: <20261202034747.F0EC01F00893@smtp.kernel.org> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The quilt patch titled Subject: mm/damon/core: fix damos_walk() hang with zero watermarks interval has been removed from the -mm tree. Its filename was mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval.patch This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Yifan Feng Subject: mm/damon/core: fix damos_walk() hang with zero watermarks interval Date: Mon, 23 Nov 2026 07:00:47 -0800 kdamond_wait_activation() cancels damos_walk() requests while all schemes are deactivated by their watermarks. But it returns without waiting when the watermarks check interval of a deactivated scheme is zero, which is the default of the DAMON sysfs interface. The kdamond main loop then runs with all schemes deactivated. In that state, kdamond_apply_schemes() finds no scheme to apply and returns before it calls damos_walk_complete(). The walk request is neither completed nor cancelled, so damos_walk() waits until the watermarks activate a scheme again, possibly forever. For example, with a scheme that has the free_mem_rate metric, zero interval_us and a high watermark below the current free memory rate, writing update_schemes_tried_regions to the kdamond state file never returns and cannot be killed. The writer holds damon_sysfs_lock, so all other DAMON sysfs writes including "off" fail with -EBUSY meanwhile. Cancel the walk request in kdamond_apply_schemes() when no scheme is activated, as kdamond_wait_activation() does for a non-zero interval. Link: https://patch.msgid.link/20261123150049.81317-3-sj@kernel.org Link: https://lore.kernel.org/20261121025626.75981-1-evanfengff@gmail.com Fixes: bf0eaba0ff9c ("mm/damon/core: implement damos_walk()") Signed-off-by: Yifan Feng Signed-off-by: SJ Park Signed-off-by: Andrew Morton Suggested-by: SJ Park Reviewed-by: SJ Park Cc: David Carlier Cc: # 6.14.x mm/damon/core.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/mm/damon/core.c~mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval +++ a/mm/damon/core.c @@ -3492,9 +3492,13 @@ static noinline_for_stack void kdamond_a struct damon_target *t; struct damos *s; bool has_schemes_to_apply = false; + bool has_activated_schemes = false; unsigned long max_region_sz; damon_for_each_scheme(s, c) { + if (s->wmarks.activated) + has_activated_schemes = true; + if (time_before(c->passed_sample_intervals, s->next_apply_sis)) continue; @@ -3506,8 +3510,12 @@ static noinline_for_stack void kdamond_a damos_adjust_quota(c, s); } - if (!has_schemes_to_apply) + if (!has_schemes_to_apply) { + /* The walk cannot be completed while no scheme is activated */ + if (!has_activated_schemes) + damos_walk_cancel(c); return; + } max_region_sz = damon_region_sz_limit(c); mutex_lock(&c->walk_control_lock); _ Patches currently in -mm which might be from evanfengff@gmail.com are tools-mm-page_owner_sort-fix-slab-allocator-labelling.patch