Re: [PATCH v3 1/2] selftests/mm: track the modules run_vmtests.sh loads
From: Zi Yan
Date: Thu Oct 29 2026 - 22:15:13 EST
On 29 Oct 2026, at 2:24, Qiliang Yuan wrote:
> run_vmtests.sh loads hwpoison_inject for the memory-failure test when it
> is not there yet, remembers that in a variable local to run_test() and
> unloads the module right after the test.
>
> The thp tests need xfs loaded in the same way, and repeating the load,
> the bookkeeping and the unload for every module that some test needs
> does not scale.
>
> Add load_module(), which loads a module unless it is already present
> and records it, and unload every recorded module, in reverse order,
> before the script exits. Use it for hwpoison_inject.
>
> Signed-off-by: Qiliang Yuan <odys.yuan@xxxxxxxxx>
> Tested-by: Jose A. Perez de Azpillaga <azpijr@xxxxxxxxx>
> Reviewed-by: Jose A. Perez de Azpillaga <azpijr@xxxxxxxxx>
> ---
> tools/testing/selftests/mm/run_vmtests.sh | 31 +++++++++++++++++++++++--------
> 1 file changed, 23 insertions(+), 8 deletions(-)
>
Thanks.
Acked-by: Zi Yan <ziy@xxxxxxxxxx>
Best Regards,
Yan, Zi