From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 91C7E370AE2 for ; Fri, 29 May 2026 04:07:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780027666; cv=none; b=cey+CeS0nd1rd7l5tOufXBQOnN4SYQBv/TnbXHjmy3ZWo5IZtUmHM43Vyk2PPzzbUe1gcxKoy/v5PtslxbPqjmYuZ+X4egDFB+myyDpiyc4qSmUjXx2kERUbyll5kGBVSXbxgByrGd9aEg9pDnuDpiPe3TSsor/gxLpkKF/WU3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780027666; c=relaxed/simple; bh=SMYt232lMuW1Wrn5QEdGs1Iypf4N3jwbD+Ux2Mlsmb4=; h=Date:To:From:Subject:Message-Id; b=o6zEanbe3pvEeSiCOHRaoAx3MprFweYt6sxH1WK1Fbp8kaixoxjZIxrQfnn+yiksLr7vWo+KcIaMt8CfcZ9T0Tfv4KKJxplHf7v5AFEMNCA4Zy1rl9rqHnIuJuCEcc9dPfTnGRTA4HQojrt916AUp2kqU+0tZPnknj5BQlHTLKQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=uyRwZOQi; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="uyRwZOQi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65B211F00893; Fri, 29 May 2026 04:07:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1780027665; bh=1fcPzEhadHRG3dbp770xw8Zs/VoDJQxOsshF2WWNABc=; h=Date:To:From:Subject; b=uyRwZOQi+n44Prh5nfA8Dnwfslt1zQC11DYF6hkf1j/WyY/8aXPGxMff81yKD27xs BVsb7H3LY4xxQxVd2ENwWX85oINGzg9CPdmWdPTKTpos5ejKIJFzvM7/4CleLbpBKM igEn2MY22kAMVghaiq5dzQhABHbladCioPUfiKZQ= Date: Thu, 28 May 2026 21:07:45 -0700 To: mm-commits@vger.kernel.org,vbabka@kernel.org,surenb@google.com,shuah@kernel.org,rppt@kernel.org,mhocko@suse.com,ljs@kernel.org,liam@infradead.org,david@kernel.org,corbet@lwn.net,brendan.higgins@linux.dev,sj@kernel.org,akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-stable] selftests-damon-sysfspy-pause-damon-before-dumping-status.patch removed from -mm tree Message-Id: <20260529040745.65B211F00893@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The quilt patch titled Subject: selftests/damon/sysfs.py: pause DAMON before dumping status has been removed from the -mm tree. Its filename was selftests-damon-sysfspy-pause-damon-before-dumping-status.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 Subject: selftests/damon/sysfs.py: pause DAMON before dumping status Date: Mon, 27 Apr 2026 08:12:29 -0700 The sysfs.py test commits DAMON parameters, dump the internal DAMON state, and show if the parameters are committed as expected using the dumped state. While the dumping is ongoing, DAMON is alive. It can make internal changes including addition and removal of regions. It can therefore make a race that can result in false test results. Pause DAMON execution during the state dumping to avoid such races. Link: https://lore.kernel.org/20260427151231.113429-11-sj@kernel.org Signed-off-by: SeongJae Park Cc: Brendan Higgins Cc: David Hildenbrand Cc: Jonathan Corbet Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: Michal Hocko Cc: Mike Rapoport Cc: Shuah Khan Cc: Suren Baghdasaryan Cc: Vlastimil Babka Signed-off-by: Andrew Morton --- tools/testing/selftests/damon/sysfs.py | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) --- a/tools/testing/selftests/damon/sysfs.py~selftests-damon-sysfspy-pause-damon-before-dumping-status +++ a/tools/testing/selftests/damon/sysfs.py @@ -198,18 +198,55 @@ def assert_ctx_committed(ctx, dump): assert_true(dump['pause'] == ctx.pause, 'pause', dump) def assert_ctxs_committed(kdamonds): + ctxs_paused_for_dump = [] + kdamonds_paused_for_dump = [] + # pause for safe state dumping + for kd in kdamonds.kdamonds: + for ctx in kd.contexts: + if ctx.pause is False: + ctx.pause = True + ctxs_paused_for_dump.append(ctx) + if not kd in kdamonds_paused_for_dump: + kdamonds_paused_for_dump.append(kd) + if kd in kdamonds_paused_for_dump: + err = kd.commit() + if err is not None: + print('pause fail (%s)' % err) + kdamonds.stop() + exit(1) + status, err = dump_damon_status_dict(kdamonds.kdamonds[0].pid) if err is not None: print(err) kdamonds.stop() exit(1) + # resume contexts paused for safe state dumping + for ctx in ctxs_paused_for_dump: + ctx.pause = False + for kd in kdamonds_paused_for_dump: + err = kd.commit() + if err is not None: + print('resume fail (%s)' % err) + kdamonds.stop() + exit(1) + + # restore for comparison + for ctx in ctxs_paused_for_dump: + ctx.pause = True + ctxs = kdamonds.kdamonds[0].contexts dump = status['contexts'] assert_true(len(ctxs) == len(dump), 'ctxs length', dump) for idx, ctx in enumerate(ctxs): assert_ctx_committed(ctx, dump[idx]) + # restore for the caller + for kd in kdamonds.kdamonds: + for ctx in kd.contexts: + if ctx in ctxs_paused_for_dump: + ctx.pause = False + def main(): kdamonds = _damon_sysfs.Kdamonds( [_damon_sysfs.Kdamond( @@ -309,6 +346,7 @@ def main(): print('kdamond start failed: %s' % err) exit(1) kdamonds.kdamonds[0].contexts[0].targets[1].obsolete = True + kdamonds.kdamonds[0].contexts[0].pause = True kdamonds.kdamonds[0].commit() del kdamonds.kdamonds[0].contexts[0].targets[1] assert_ctxs_committed(kdamonds) _ Patches currently in -mm which might be from sj@kernel.org are mm-damon-ops-common-call-folio_test_lru-after-folio_get.patch mm-damon-reclaim-handle-ctx-allocation-failure.patch mm-damonn-lru_sort-handle-ctx-allocation-failure.patch mm-damon-core-introduce-struct-damon_probe.patch mm-damon-core-embed-damon_probe-objects-in-damon_ctx.patch mm-damon-core-introduce-damon_filter.patch mm-damon-core-commit-probes.patch mm-damon-core-introduce-damon_region-probe_hits.patch mm-damon-core-introduce-damon_ops-apply_probes.patch mm-damon-core-do-data-attributes-monitoring.patch mm-damon-paddr-support-data-attributes-monitoring.patch mm-damon-sysfs-implement-probes-dir.patch mm-damon-sysfs-implement-probe-dir.patch mm-damon-sysfs-implement-filters-directory.patch mm-damon-sysfs-implement-filter-dir.patch mm-damon-sysfs-implement-filter-dir-files.patch mm-damon-sysfs-setup-probes-on-damon-core-api-parameters.patch mm-damon-sysfs-schemes-implement-tried_regions-r-probes.patch mm-damon-sysfs-schemes-implement-probe-dir.patch mm-damon-sysfs-schemes-implement-probe-hits-file.patch mm-damon-trace-probe_hits.patch selftests-damon-sysfssh-test-probes-dir.patch docs-mm-damon-design-document-data-attributes-monitoring.patch docs-admin-guide-mm-damon-usage-document-data-attributes-monitoring.patch mm-damon-core-introduce-damon_filter_type_memcg.patch mm-damon-paddr-support-damon_filter_type_memcg.patch mm-damon-sysfs-add-filters-f-path-file.patch mm-damon-sysfs-schemes-move-memcg_path_to_id-to-sysfs-common.patch mm-damon-sysfs-setup-damon_filter-memcg_id-from-path.patch docs-mm-damon-design-update-for-memcg-damon-filter.patch docs-admin-guide-mm-damon-usage-update-for-memcg-damon-filter.patch mm-damon-core-safely-handle-no-region-case-in-damon_set_regions.patch mm-damon-core-do-not-use-region-out-of-a-loop-in-damon_set_regions.patch samples-damon-mtier-replace-damon_add_region-with-damon_set_regions.patch mm-damon-tests-vaddr-kunit-replace-damon_add_region-with-damon_set_regions.patch mm-damon-core-hide-damon_add_region.patch mm-damon-core-hide-damon_insert_region.patch mm-damon-core-hide-damon_destroy_region.patch mm-damon-core-add-kdamond_call-debug_sanity-check.patch mm-damon-core-remove-damon_verify_nr_regions.patch mm-damon-tests-core-kunit-add-damon_set_regions-test-cases.patch selftests-damon-sysfspy-stop-kdamonds-before-failing.patch selftests-damon-sysfssh-test-monitoring-intervals-goal-dir.patch selftests-damon-sysfssh-test-addr_unit-file-existence.patch selftests-damon-sysfssh-test-pause-file-existence.patch mm-damon-core-trace-esz-at-first-setup.patch