* + selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility.patch added to mm-new branch
@ 2026-09-15 2:00 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-09-15 2:00 UTC (permalink / raw)
To: mm-commits, eva.kurchatova, akpm
The patch titled
Subject: selftests/damon: add script dir to sys.path for PYTHONSAFEPATH compatibility
has been added to the -mm mm-new branch. Its filename is
selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility.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: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Subject: selftests/damon: add script dir to sys.path for PYTHONSAFEPATH compatibility
Date: Mon, 14 Sep 2026 07:19:48 -0700
Running these tests under Python's safe path mode, either with -P on the
interpreter command line or with PYTHONSAFEPATH set in the environment,
stops the script's own directory being prepended to sys.path. Some
distributions (RHEL, for example) build the tests with -P in the shebang.
This breaks all 7 DAMON Python selftests that import the _damon_sysfs
helper module located in the same directory:
ModuleNotFoundError: No module named '_damon_sysfs'
Fix this by explicitly adding the script's directory to sys.path before
importing _damon_sysfs, following the same pattern used in commit
c3b3eb565bd7 ("tools: ynl: add script dir to sys.path") which fixed the
identical issue for the YNL tools.
Link: https://lore.kernel.org/20260914141952.91465-4-sj@kernel.org
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: SJ Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@davidgow.net>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kunwu Chan <kunwu.chan@gmail.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lian Wang <lianux.mm@gmail.com>
Cc: Liew Rui Yan <aethernet65535@gmail.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: "Zenghui Yu (Huawei)" <zenghui.yu@linux.dev>
---
tools/testing/selftests/damon/damon_nr_regions.py | 3 +++
tools/testing/selftests/damon/damos_apply_interval.py | 3 +++
tools/testing/selftests/damon/damos_quota.py | 3 +++
tools/testing/selftests/damon/damos_quota_goal.py | 3 +++
tools/testing/selftests/damon/damos_tried_regions.py | 3 +++
tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_hang.py | 3 +++
tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_wss_estimation.py | 3 +++
7 files changed, 21 insertions(+)
--- a/tools/testing/selftests/damon/damon_nr_regions.py~selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility
+++ a/tools/testing/selftests/damon/damon_nr_regions.py
@@ -1,9 +1,12 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
+import os
import subprocess
+import sys
import time
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import _damon_sysfs
def test_nr_regions(real_nr_regions, min_nr_regions, max_nr_regions):
--- a/tools/testing/selftests/damon/damos_apply_interval.py~selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility
+++ a/tools/testing/selftests/damon/damos_apply_interval.py
@@ -1,9 +1,12 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
+import os
import subprocess
+import sys
import time
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import _damon_sysfs
def main():
--- a/tools/testing/selftests/damon/damos_quota_goal.py~selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility
+++ a/tools/testing/selftests/damon/damos_quota_goal.py
@@ -1,9 +1,12 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
+import os
import subprocess
+import sys
import time
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import _damon_sysfs
def main():
--- a/tools/testing/selftests/damon/damos_quota.py~selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility
+++ a/tools/testing/selftests/damon/damos_quota.py
@@ -1,9 +1,12 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
+import os
import subprocess
+import sys
import time
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import _damon_sysfs
def main():
--- a/tools/testing/selftests/damon/damos_tried_regions.py~selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility
+++ a/tools/testing/selftests/damon/damos_tried_regions.py
@@ -1,9 +1,12 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
+import os
import subprocess
+import sys
import time
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import _damon_sysfs
def main():
--- a/tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_hang.py~selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility
+++ a/tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_hang.py
@@ -1,9 +1,12 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
+import os
import subprocess
+import sys
import time
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import _damon_sysfs
def main():
--- a/tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_wss_estimation.py~selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility
+++ a/tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_wss_estimation.py
@@ -1,9 +1,12 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
+import os
import subprocess
+import sys
import time
+sys.path.append(os.path.dirname(os.path.abspath(__file__)))
import _damon_sysfs
def pass_wss_estimation(sz_region):
_
Patches currently in -mm which might be from eva.kurchatova@virtuozzo.com are
selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-15 2:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 2:00 + selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility.patch added to mm-new branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.