[LTP] [PATCH] hugepages: ensure CONFIG_COMPACTION is defined

Petr Vorel pvorel@suse.cz
Fri Jul 17 11:32:40 CEST 2026


Hi Andrea,

> Add check to ensure CONFIG_COMPACTION=y when we need to use hugepages
> inside tests. The kernel configuration is used to enable usage of
> `/proc/sys/vm/compact_memory` inside the LTP core library.

> The issue was raised by https://github.com/linux-test-project/ltp/pull/1335
> that is trying to solve a problem with cachestat03.
> ---
>  lib/tst_hugepage.c | 5 +++++
....
> +	if (access(PATH_VM_COMPACT_MEMORY, F_OK)) {
> +		if (hp->policy == TST_NEEDS || hp->policy == TST_REQUEST)
> +			tst_brk(TCONF, "CONFIG_COMPACTION not enabled in kernel");

I'd at least add a question mark when it's not based on a real kconfig
inspection. Because there might be different reasons for missing file in the
future.

Kind regards,
Petr


More information about the ltp mailing list