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=1796183284; b=snQvhS9l966KTCxh3zop4vqxcCkQvLXYkq1dA0Jwt4j+IqOCUrEASGJv9MUv2wOG4Guf QICwqdLUPoT2UUwG6Qf3J3XCUywWtwWwQEEi8WSM71H/XykTTHrihw2eqlcplitYDYwGt 4mP9G2b6cCrBz4u15ZecwaCJ5hVXdaLvdogBXs4g6JKcfmPQaCT4edyguxFp2GYI9bKWR 0l++jZyd2RB5mJ92S8hegfKDGBH95SZyl4jVdoz1sVzrha6Hkdrcm0lEzl5BT2ot1jugh O7AEsFl1G6pTd5l9pgF9XjN2l5DLPh16Gi9aoBc895IukKDQJiWbreMfzg+A9BVB4qQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796183284; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=OAhP68UOKPUo4CW+Yh7drZx9YlnU4OZ2pWmIP1jVwaE=; b=VLsNtF2JHihqqlJ6+SCTEYHljHW3hkGiQWkl+fTXZ9H1md0vO1g6Wxt9liiDUFzThAgz AXoTojZoa+vx3GRFJZxJf/LHTJDRFfRm/SRd719of2bhZ57XmOZ1uYNgvXiwRLo+RjOC/ +GkDZz5xkQlE2QSsDZ8JFAWuQ8uxRd4pnN9U+R+tkfUA4OZvWt1t1e0xw9JIJDP3yxeJB nc+UCuXAaVw8neMDwNRoIkR7JTkclkJ/5KH71fZAdERt4XEwz0q7wQwLhGRrKL9R263DB zsZzRKDXRnkoHhHMhkCZihxOfvcveSET+jmqKWtLsfpIVM9AB5Lk3qnOVUvpZ0OvNYw== 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=p6kIMD3O; 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 D80C3606A322; Wed, 2 Dec 2026 03:48:04 +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=p6kIMD3O Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62C881F00893; Wed, 2 Dec 2026 03:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796183284; bh=OAhP68UOKPUo4CW+Yh7drZx9YlnU4OZ2pWmIP1jVwaE=; h=Date:To:From:In-Reply-To:References:Subject; b=p6kIMD3O1V3g2hJ1TZ2j4IHNHliMt46lEbBmMBw3k3ORP5fwL7Hj/2PnebHgrj4le Wirv3bGy0RLrH9zJMJUXfgOszCOzL7x6AO4A/z4MBub01YMR0bW0P9seqS1t6MThlr GJPYMWBWCmzzYCD0dG4969zyhKYbLVUDEeQa3bos= Date: Tue, 01 Dec 2026 19:48:04 -0800 To: mm-commits@vger.kernel.org,stable@vger.kernel.org,sj@kernel.org, akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261127203116.92895-1-sj@kernel.org> References: <20261127203116.92895-1-sj@kernel.org> Subject: [merged mm-hotfixes-stable] mm-damon-core-cleanup-damos-walk_completed-in-damos_walk_cancel.patch removed from -mm tree Message-Id: <20261202034804.62C881F00893@smtp.kernel.org> X-Mailing-List: mm-commits@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: cleanup damos->walk_completed in damos_walk_cancel() has been removed from the -mm tree. Its filename was mm-damon-core-cleanup-damos-walk_completed-in-damos_walk_cancel.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: SJ Park Subject: mm/damon/core: cleanup damos->walk_completed in damos_walk_cancel() Date: Fri, 27 Nov 2026 12:31:15 -0800 DAMOS walk could be unexpectedly only partially performed. It can happen when there are multiple schemes and the walk is requested after the previous walk is canceled. The expectation of DAMOS walk for a setup that has multiple schemes is that it will walk for one snapshot for all schemes. To know if the walk for the one snapshot of a given scheme is done, each damos struct has the walk_completed field. It is set when the walk for the given scheme is completed. The walk skips schemes having the field set. It is reset for all schemes when all the schemes get it set. damos_walk_cancel() cancels all existing walks. But it does not reset the walk_completed field. damos_walk_cancel() can be called at any kdamond loop iteration. For example, due to DAMON context pause or DAMOS watermarks-caused deactivation. It means that the function can be called while only some of the schemes completed their walks. And users could request another walk after the canceled walk. In the case, because some of the schemes still have walk_completed fields set, the walk for them is skipped. As a result, DAMOS walk based user operations such as update_schemes_tried_bytes kdamond command could show incomplete output. Fix by unsetting the fields of all schemes in damos_walk_cancel(). The user impact is not critical. No crash or leak happens. Only DAMOS based monitoring results retrieval could work unexpectedly, under the certain setup and the race. Given the best effort nature of DAMON, such occasional monitoring quality degradation would be not critical. The issue has found from the Sashiko bug database. Link: https://patch.msgid.link/20261127203116.92895-1-sj@kernel.org Fixes: bf0eaba0ff9c ("mm/damon/core: implement damos_walk()") Signed-off-by: SJ Park Signed-off-by: Andrew Morton Closes: https://sashiko.dev/#/bug/linux-228a4c52-0545-4c1f-90ce-41114d8272e9 Cc: # 6.14.x mm/damon/core.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/mm/damon/core.c~mm-damon-core-cleanup-damos-walk_completed-in-damos_walk_cancel +++ a/mm/damon/core.c @@ -2703,6 +2703,7 @@ static void damos_walk_complete(struct d static void damos_walk_cancel(struct damon_ctx *ctx) { struct damos_walk_control *control; + struct damos *s; mutex_lock(&ctx->walk_control_lock); control = ctx->walk_control; @@ -2710,6 +2711,9 @@ static void damos_walk_cancel(struct dam if (!control) return; + + damon_for_each_scheme(s, ctx) + s->walk_completed = false; control->canceled = true; complete(&control->completion); mutex_lock(&ctx->walk_control_lock); _ Patches currently in -mm which might be from sj@kernel.org are mm-damon-core-copy-only-installed-probe-in-damon_split_region_at.patch mm-damon-core-add-damos_filter_type_age_ms.patch mm-damon-sysfs-schemes-support-damos_filter_type_age_ms.patch docs-mm-damon-design-update-for-age_ms-damos-core-filter-type.patch docs-admin-guide-mm-damon-usage-update-for-age_ms-damos-core-filter.patch mm-damon-api-define-damon_filter_type_active.patch mm-damon-ops-common-implement-damon_filter_type_active-operation.patch mm-damon-sysfs-support-lru-activeness-based-damon-filter-setup.patch docs-mm-damon-design-update-for-damon_filter_type_active.patch maintainers-change-damon-scm-tree-to-mm-damongit.patch docs-mm-damon-maintainer-profile-use-damongit-for-patch-baselines.patch docs-mm-damon-maintainer-profile-drop-scm-trees-section.patch docs-mm-damon-maintainer-profile-update-key-cycle-dates-for-damongit.patch mm-damon-api-introduce-struct-damon_report.patch mm-damon-core-implement-data-attribute-report-queue.patch mm-damon-core-introduce-damon_submit_report.patch mm-damon-sysfs-add-admin-reports-directory.patch mm-damon-sysfs-add-reports-producers-directory.patch mm-damon-sysfs-add-producers-nr_producers-file.patch mm-damon-sysfs-implement-report-producer-directory.patch mm-damon-sysfs-implement-report-producer-type-and-state-files.patch docs-mm-damon-design-update-for-report-system.patch docs-admin-guide-mm-damon-usage-update-for-report-producer-sysfs.patch docs-abi-damon-update-for-report-producer-sysfs-files.patch mm-damon-core-introduce-damon_filter_type_report_made.patch mm-damon-core-introduce-damon_report_exist.patch mm-damon-paddr-support-report_made-type-probe-filter.patch mm-damon-sysfs-add-filter_report_type-file-under-probe-filter-directory.patch mm-damon-sysfs-support-report_made-type-probe-filter-setup.patch docs-mm-damon-design-update-for-report_made-probe-filter-type.patch docs-admin-guide-mm-damon-usage-update-for-report_made-probe-filter.patch docs-abi-damon-update-for-report_made-probe-filter.patch mm-damon-api-introduce-user_report-report-type.patch mm-damon-sysfs-add-user_report-support-for-report-type-input.patch mm-damon-sysfs-implement-report-producer-addr_startend-files.patch mm-damon-sysfs-implement-submit-command-for-report-producer.patch selftests-damon-sysfssh-add-basic-tests-for-admin-reports.patch docs-mm-damon-design-update-for-user-report-support.patch docs-admin-guide-mm-damon-usage-update-for-user_report-report-support.patch docs-abi-damon-update-for-user_report-report-support.patch mm-damon-sysfs-define-damon_sysfs_cmd_name-type-and-array.patch mm-damon-sysfs-use-damon_sysfs_cmd_names-in-state_store.patch mm-damon-sysfs-use-damon_sysfs_cmd_names-in-state_show.patch mm-damon-sysfs-remove-damon_sysfs_cmd_strs-and-nr_damon_sysfs_cmds.patch mm-damon-kconfig-update-for-features-other-than-access-monitoring.patch mm-damon-kconfig-clarify-kunit-scope-of-kunit-configs.patch mm-damon-vaddr-advance-migration-attempt-in-folio-level-for-filter-out.patch mm-damon-vaddr-use-damos-last_applied-for-migrate-action.patch mm-damon-vaddr-implement-sz_filter_passed-for-migrate_hotcold-action.patch mm-damon-sysfs-schemes-drop-redundant-and-racy-zero-target_value-check.patch selftests-damon-damos_apply_interval-remove-unused-variables.patch selftests-damon-remove-unused-imports-of-sys-and-time-modules.patch mm-damon-update-file-intro-comments-to-call-damon-just-damon.patch