[PATCH v4 07/15] selftests/mm: free dynamically allocated PMD-sized buffers in split_huge_page_test
Zi Yan
ziy at nvidia.com
Wed Apr 8 00:44:25 AEST 2026
On 6 Apr 2026, at 5:19, Sayali Patil wrote:
> Dynamically allocated buffers of PMD size for file-backed
> THP operations (file_buf1 and file_buf2) were not freed on
> the success path and some failure paths. Since the
> function is called repeatedly in a loop for each split order,
> this can cause significant memory leaks.
>
> On architectures with large PMD sizes, repeated leaks
> could exhaust system memory and trigger the OOM killer
> during test execution.
>
> Ensure all allocated buffers are freed to maintain
> stable repeated test runs.
>
> Fixes: 035a112e5fd5 ("selftests/mm: make file-backed THP split work by writing PMD size data")
> Signed-off-by: Sayali Patil <sayalip at linux.ibm.com>
> ---
> .../selftests/mm/split_huge_page_test.c | 22 ++++++++++++++-----
> 1 file changed, 16 insertions(+), 6 deletions(-)
>
Thank you for fixing it.
Reviewed-by: Zi Yan <ziy at nvidia.com>
Best Regards,
Yan, Zi
More information about the Linuxppc-dev
mailing list