Skip to contentSkip to conversation

selftests/cgroup: Make the object directory an order-only prerequisite

PATCH Applied Fuad Tabba 2 participants 2 messages Nov 13

Subsystems (4)
lore
Share & tools
lore

Fuad Tabba

author reviewer
#0 lore raw

PATCH v3 1/1 selftests/cgroup: Make the object directory an order-only prerequisite

The cgroup_util.o rule in libcgroup.mk lists the object directory as a normal prerequisite. The KVM selftests include libcgroup.mk, so for them that directory is their own $(OUTPUT)/lib. After any incremental KVM build that rebuilds an object there, the directory is newer than cgroup_util.o, and the next build recompiles cgroup_util.o and relinks every test.

Make the directory an order-only prerequisite, as libvfio.mk does.

---

Notes:
This was patch 2/2 of v2 [1]. Sean took patch 1 through kvm-x86 and asked for this one to go through the cgroup tree [2].

Changes since v2:
- Collected Michal's Acked-by.
- Rebased on cgroup/for-7.5.
- Dropped the Fixes: tag, as the patch only saves a rebuild.

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/

 tools/testing/selftests/cgroup/lib/libcgroup.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/cgroup/lib/libcgroup.mk +1 -1
index 7a73007204c39..bcf6fe2516223 100644
@@ -13,7 +13,7 @@ EXTRA_HDRS := $(selfdir)/clone3/clone3_selftests.h
 $(LIBCGROUP_O_DIRS):
 	mkdir -p $@
 
-$(LIBCGROUP_O): $(OUTPUT)/%.o : $(CGROUP_DIR)/%.c $(EXTRA_HDRS) $(LIBCGROUP_O_DIRS)
+$(LIBCGROUP_O): $(OUTPUT)/%.o : $(CGROUP_DIR)/%.c $(EXTRA_HDRS) | $(LIBCGROUP_O_DIRS)
 	$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
 
 EXTRA_CLEAN += $(LIBCGROUP_O)

base-commit: 80bf33fd523ee1df2d265d34970df670a44a2ccd

Signature · 1 line
2.47.3
maintainer Applied
#1 lore raw

Applied to cgroup/for-7.5.

Thanks.

--
tejun