Re: [PATCH v3 2/4] selftests/arm64: Treat KSM merge_across_nodes as optional

From: Vincenzo Frascino

Date: Wed Aug 26 2026 - 04:28:25 EST




On 25/08/2026 12:18, Muhammad Usama Anjum wrote:
> The MTE KSM test requires write access to KSM sysfs but does not check
> that it is running as root. It also unconditionally saves, enables and
> restores the merge_across_nodes attribute. The kernel only creates this
> attribute when CONFIG_NUMA=y, so a non-NUMA kernel prints the following
> message three times even though every KSM subtest passes:
>
> # ERR: missing /sys/kernel/mm/ksm/merge_across_nodes
>
> Skip the test when it is not running as root. Check that the optional
> attribute is readable and writable, treating ENOENT as its expected
> absence on non-NUMA kernels and skipping the test for other access
> failures. Only save, enable and restore the attribute when it is
> available.
>
> Check MTE availability before the privilege and sysfs checks so systems
> without MTE retain the existing feature-unavailable skip result.
>
> This preserves the existing behavior on NUMA kernels without requiring
> NUMA or reducing KSM coverage on single-node systems.
>
> Fixes: f981d8fa2646 ("kselftest/arm64: Verify KSM page merge for MTE pages")
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@xxxxxxx>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@xxxxxxx>

...