selftests/mm: link with thp_settings when necessary
Subsystems (3)
PATCH 1/1 selftests/mm: link with thp_settings when necessary
Currently all test cases are linked with thp_settings, while only 6 out of 50+ targets rely on it.
Instead of making thp_settings as a common dependency, link it only when necessary.
--- tools/testing/selftests/mm/Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
tools/testing/selftests/mm/Makefile +8 -3
@@ -158,14 +158,19 @@ TEST_FILES += write_hugetlb_memory.sh include ../lib.mk -$(TEST_GEN_PROGS): vm_util.c thp_settings.c -$(TEST_GEN_FILES): vm_util.c thp_settings.c +$(TEST_GEN_PROGS): vm_util.c +$(TEST_GEN_FILES): vm_util.c $(OUTPUT)/uffd-stress: uffd-common.c $(OUTPUT)/uffd-unit-tests: uffd-common.c -$(OUTPUT)/uffd-wp-mremap: uffd-common.c +$(OUTPUT)/uffd-wp-mremap: uffd-common.c thp_settings.c $(OUTPUT)/protection_keys: pkey_util.c $(OUTPUT)/pkey_sighandler_tests: pkey_util.c +$(OUTPUT)/cow: thp_settings.c +$(OUTPUT)/migration: thp_settings.c +$(OUTPUT)/khugepaged: thp_settings.c +$(OUTPUT)/ksm_tests: thp_settings.c +$(OUTPUT)/soft-dirty: thp_settings.c ifeq ($(ARCH),x86_64) BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32))
Signature · 1 line
2.34.1
Quoted 5 lines · Wei Yang
Currently all test cases are linked with
thp_settings, while only 6 out of 50+ targets rely on it.Instead of making
thp_settingsas a common dependency, link it only when necessary.
You don't state why we should care about that? I don't see how binary size is a problem, why do you think it is?
Signature · 3 lines
Cheers, David / dhildenb
Quoted 10 lines · David Hildenbrand
Quoted 5 lines · Wei Yang
Currently all test cases are linked with
thp_settings, while only 6 out of 50+ targets rely on it.Instead of making
thp_settingsas a common dependency, link it only when necessary.You don't state why we should care about that? I don't see how binary size is a problem, why do you think it is?
Yeah overall I'm with David on this, I'd rather we keep things simple (so you don't need to remember to link against this file) and just plonk all the stuff you need to link to together in the Makefile.
It's not really a big deal when it comes to test stuff I don't think.
Cheers, Lorenzo
Quoted 9 lines · Lorenzo Stoakes
Quoted 8 lines · David Hildenbrand
Quoted 5 lines · Wei Yang
Currently all test cases are linked with
thp_settings, while only 6 out of 50+ targets rely on it.Instead of making
thp_settingsas a common dependency, link it only when necessary.
Quoted 6 lines
Quoted 2 lines
You don't state why we should care about that? I don't see how binary size is a problem, why do you think it is?
Yeah overall I'm with David on this, I'd rather we keep things simple (so you don't need to remember to link against this file) and just plonk all the stuff you need to link to together in the
Makefile.
I have thought about this, while current implementation do specify its necessary dependency for some target like uffd-common.c/pkey_util.c.
So I thought we may keep the same style.
Quoted 3 lines
It's not really a big deal when it comes to test stuff I don't think.
Yes, this is not a big deal in general. I come up with this idea because my test machine is too old. This change could same me some time during coding/debugging.
Quoted 1 line
Cheers, Lorenzo
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 11 lines · David Hildenbrand
Quoted 5 lines · Wei Yang
Currently all test cases are linked with
thp_settings, while only 6 out of 50+ targets rely on it.Instead of making
thp_settingsas a common dependency, link it only when necessary.You don't state why we should care about that? I don't see how binary size is a problem, why do you think it is?
Yes, it doesn't help on the binary size perspective.
I come up with this when doing some test. Each time a change in thp_settings would rebuild all the tests. My intent is to speed up the build during coding.
Not sure it worth a change.
Quoted 3 lines
Cheers,
David / dhildenb
Signature · 2 lines
Wei Yang Help you, Help me