[Devel] [PATCH vz10] selftests: cgroup: make test_numa_migrate depend on cgroup_util.o

Konstantin Khorenko khorenko at virtuozzo.com
Fri Sep 4 11:41:04 MSK 2026


applied

60f375bfa3605 selftests: cgroup: make test_numa_migrate depend on cgroup_util.o

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 9/3/26 22:58, Konstantin Khorenko wrote:
> The cgroup/Makefile line for test_numa_migrate
> 
>   $(OUTPUT)/test_numa_migrate: LDLIBS += -lnuma $(LIBCGROUP_O)
> 
> is a target-specific variable assignment, so $(LIBCGROUP_O) ends up
> inside the LDLIBS value instead of being a prerequisite of the target.
> Unlike all the other cgroup tests, test_numa_migrate thus does not
> depend on lib/cgroup_util.o. Under "make -j32" its link job may start
> while the compiler is still writing the object, and ld fails with
> 
>   .../cgroup/lib/cgroup_util.o: file not recognized: file format not recognized
>   collect2: error: ld returned 1 exit status
>   make[1]: *** [../lib.mk:222: .../cgroup/test_numa_migrate] Error 1
> 
> The object still gets on the link command line via LDLIBS, so the build
> succeeds whenever the object happens to be finished first, which made
> the failure appear only occasionally in the kernel rpm build.
> 
> Split the line: keep "-lnuma" in the target-specific LDLIBS and list
> $(LIBCGROUP_O) as a prerequisite the same way the other tests do.
> lib.mk passes the prerequisites to the linker, so the resulting command
> is "test_numa_migrate.c lib/cgroup_util.o -lnuma", and make now builds
> the object before linking the test.
> 
> Fixes: 5f3322b25e274 ("selftests: cgroup: test numa migration of lruvecs")
> https://virtuozzo.atlassian.net/browse/VSTOR-139774
> 
> Feature: mm: interface to migrate memory between NUMA nodes upon userspace request
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
> ---
>  tools/testing/selftests/cgroup/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/cgroup/Makefile b/tools/testing/selftests/cgroup/Makefile
> index a0b52fb9bb341..9fa4549ac139a 100644
> --- a/tools/testing/selftests/cgroup/Makefile
> +++ b/tools/testing/selftests/cgroup/Makefile
> @@ -36,5 +36,6 @@ include lib/libcgroup.mk
>  $(OUTPUT)/test_memcontrol: $(LIBCGROUP_O)
>  $(OUTPUT)/test_pids: $(LIBCGROUP_O)
>  $(OUTPUT)/test_zswap: $(LIBCGROUP_O)
> -$(OUTPUT)/test_numa_migrate: LDLIBS += -lnuma $(LIBCGROUP_O)
> +$(OUTPUT)/test_numa_migrate: LDLIBS += -lnuma
> +$(OUTPUT)/test_numa_migrate: $(LIBCGROUP_O)
>  $(OUTPUT)/test_cache: $(LIBCGROUP_O)



More information about the Devel mailing list