On Wed, 9 Sep 2026 00:42:35 +0300 Eva Kurchatova
<[email protected]> wrote:
> 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.
Thank you for finding and fixing this, Eva!
>
> Signed-off-by: Eva Kurchatova <[email protected]>
Reviewed-by: SJ Park <[email protected]>
This patch is applied to damon/next [1] tree. If this patch is not added to
mm.git in short term (~1 week?), I will ask mm.git maintainer (Andrew Morton)
to pick this. So, no action from your side is needed for now. If it seems I
also forgot doing that or you cannot wait for my action, please feel free to
directly ask that to Andrew.
[1]
https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees
Thanks,
SJ
[...]