All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility.patch removed from -mm tree
@ 2026-10-13  4:31 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-13  4:31 UTC (permalink / raw)
  To: mm-commits, zenghui.yu, vbabka, surenb, sj, shuah, rppt, rdunlap,
	mhocko, ljs, lianux.mm, liam, kunwu.chan, david, davidgow, corbet,
	brendan.higgins, aethernet65535, eva.kurchatova, akpm


The quilt patch titled
     Subject: selftests/damon: add script dir to sys.path for PYTHONSAFEPATH compatibility
has been removed from the -mm tree.  Its filename was
     selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility.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: 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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-13  4:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13  4:31 [merged mm-stable] selftests-damon-add-script-dir-to-syspath-for-pythonsafepath-compatibility.patch removed from -mm tree 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.