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 D9D8637FF4D for ; Mon, 29 Jun 2026 17:44:02 +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=1782755044; cv=none; b=C2EG9iJyFIqLDlCin8cL2Ho35m5vxbnE9HOYhhiInXFD4GpIJJu0Sm4R2BdEtGDJ/G4IDYQjNfxrT3WQrVRCs6V+pNo7H8501cT47FeNy+mCOHYgSAAT46koUKYSHexPLrsUvVIH4PICDWq75RXtKJWxsIjiO4I7M534k7HTBS8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782755044; c=relaxed/simple; bh=MDf/JwmMPT+KvVf6Acy6DLSwUqOK4Q2KRCItPoe0Rjc=; h=Date:To:From:Subject:Message-Id; b=KJIZCcxFanIh+GR/P0p5svlNf/09GFSlo7o56CqPxfFjjXWzF+dARTVF+LyHX6LJizlCwZ/vrlloz5nratE+iv8a6fVKQvj1mA9P45u4LfInW4cgeLN2SVsMSlNhIB0hVoyHWftmiMwtjf/DTp+kEliD0Kdz+ogFqx2egdlqR5Q= 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=hzFEzu9y; 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="hzFEzu9y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B0761F000E9; Mon, 29 Jun 2026 17:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1782755042; bh=vREUpUvH9UqFSkPsmMUdtm3hNVxw7N9y1/daMb8Ehps=; h=Date:To:From:Subject; b=hzFEzu9yujQAtlwRfBAZkNL7qYEDeYQ5QWaC3OEoGxIs9zPdCI0086mqQhTtr0X74 dtb1n15AJtabrgGvtcfuqZb3WQmFaX+WpGSBAfAoB1WM00nOPyxArSJ4lnoe/uh1Yx lWUntwVNnmoXcgJiwhgCC7FE/eu74jttyH43BjHE= Date: Mon, 29 Jun 2026 10:44:02 -0700 To: mm-commits@vger.kernel.org,sj@kernel.org,lianux.mm@gmail.com,chentao@kylinos.cn,akpm@linux-foundation.org From: Andrew Morton Subject: + selftests-damon-prevent-cross-context-state-pollution-in-damonctx.patch added to mm-new branch Message-Id: <20260629174402.7B0761F000E9@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: selftests/damon: prevent cross-context state pollution in DamonCtx has been added to the -mm mm-new branch. Its filename is selftests-damon-prevent-cross-context-state-pollution-in-damonctx.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-damon-prevent-cross-context-state-pollution-in-damonctx.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. The mm-new branch of mm.git is not included in linux-next If a few days of testing in mm-new is successful, the patch will me moved into mm.git's mm-unstable branch, which is included in linux-next Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Kunwu Chan Subject: selftests/damon: prevent cross-context state pollution in DamonCtx Date: Mon, 29 Jun 2026 07:46:44 -0700 Patch series "selftests/damon: misc fixes for test bugs", v3. This series fixes several bugs in the DAMON selftests. Most are trivial but makes test output wrong or even silently pass the one test case for 'avail_operation' file existence check. Patch 1 fixes mutable default arguments in DamonCtx.__init__() that cause state to leak between test instances. Patch 2 fixes wrong operator precedence and join TypeError in damos_tried_regions.py. Patch 3 fixes several wrong strings that produce dead elif branches, skipped file existence checks, and broken dict key lookups. This patch (of 3): DamonCtx.__init__() uses mutable default values for monitoring_attrs, targets, and schemes. In Python these are evaluated once at function definition time, so multiple DamonCtx instances can unintentionally share the same lists and DamonAttrs instance. Replace the mutable defaults with None sentinels and initialize the objects when needed. Link: https://lore.kernel.org/20260629144648.134092-1-sj@kernel.org Link: https://lore.kernel.org/20260601032314.424013-2-kunwu.chan@linux.dev Link: https://lore.kernel.org/20260629144648.134092-2-sj@kernel.org Co-developed-by: Wang Lian Signed-off-by: Wang Lian Signed-off-by: Kunwu Chan Signed-off-by: SJ Park Reviewed-by: SJ Park Cc: Kunwu Chan Cc: Wang Lian Signed-off-by: Andrew Morton --- tools/testing/selftests/damon/_damon_sysfs.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/tools/testing/selftests/damon/_damon_sysfs.py~selftests-damon-prevent-cross-context-state-pollution-in-damonctx +++ a/tools/testing/selftests/damon/_damon_sysfs.py @@ -624,17 +624,23 @@ class DamonCtx: pause = None idx = None - def __init__(self, ops='paddr', monitoring_attrs=DamonAttrs(), targets=[], - schemes=[], pause=False): + def __init__(self, ops='paddr', monitoring_attrs=None, targets=None, + schemes=None, pause=False): self.ops = ops + if monitoring_attrs is None: + monitoring_attrs = DamonAttrs() self.monitoring_attrs = monitoring_attrs self.monitoring_attrs.context = self + if targets is None: + targets = [] self.targets = targets for idx, target in enumerate(self.targets): target.idx = idx target.context = self + if schemes is None: + schemes = [] self.schemes = schemes for idx, scheme in enumerate(self.schemes): scheme.idx = idx _ Patches currently in -mm which might be from chentao@kylinos.cn are selftests-damon-prevent-cross-context-state-pollution-in-damonctx.patch selftests-damon-damos_tried_regions-fix-expectation-output-and-join-typeerror.patch selftests-damon-fix-dead-code-skipped-checks-and-broken-lookups.patch