On Thu, Aug 28, 2025 at 03:10:16PM +0530, Bala-Vignesh-Reddy wrote: >Hi Wei, > >Thanks for testing and for your feedback. > >Yeah, if you try to build inside a subdirectory, the top level >export may not apply, so CFLAGS don't get updated, and even if >they did, the path could be pointing to wrong location. > >As the docs recommend, building selftest using TARGETS, >either from kernel source or "tools/testing/selftests/" >works fine and doesn't fail. >
But this breaks current behavior. There might be users for this form. >If you really want to build from selftests/mm/ directory then >defining KSFT_INCLUDES with a fallback in the Makefile will >resolve it, but there is no need of it if we stick with "TARGETS=mm". > How about add this in local Makefile ? For example: diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 810bd615b8c3..52f023071619 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -158,6 +158,10 @@ TEST_FILES += test_page_frag.sh # required by charge_reserved_hugetlb.sh TEST_FILES += write_hugetlb_memory.sh +ifeq ($(KSFT_INCLUDES),) +KSFT_INCLUDES := -I../ +endif + include ../lib.mk $(TEST_GEN_PROGS): vm_util.c thp_settings.c >Thanks >Bala Vignesh -- Wei Yang Help you, Help me