OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH vz10] selftests: cgroup: make test_numa_migrate depend on cgroup_util.o
@ 2026-09-03 20:58 Konstantin Khorenko
  2026-09-04  8:41 ` Konstantin Khorenko
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Khorenko @ 2026-09-03 20:58 UTC (permalink / raw)
  To: OpenVZ devel list

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@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)
-- 
2.43.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-04  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03 20:58 [Devel] [PATCH vz10] selftests: cgroup: make test_numa_migrate depend on cgroup_util.o Konstantin Khorenko
2026-09-04  8:41 ` Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox