OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: OpenVZ devel list <devel@openvz.org>
Subject: [Devel] [PATCH vz10] selftests: cgroup: make test_numa_migrate depend on cgroup_util.o
Date: Thu,  3 Sep 2026 22:58:06 +0200	[thread overview]
Message-ID: <20260903205807.1322151-1-khorenko@virtuozzo.com> (raw)

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

             reply	other threads:[~2026-09-03 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 20:58 Konstantin Khorenko [this message]
2026-09-04  8:41 ` Konstantin Khorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260903205807.1322151-1-khorenko@virtuozzo.com \
    --to=khorenko@virtuozzo.com \
    --cc=devel@openvz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox