public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] selftests/mm: clean up build output and verbosity
@ 2026-03-31  9:44 Li Wang
  2026-03-31  9:44 ` [PATCH v2 1/2] selftests/mm: respect build verbosity settings for 32/64-bit targets Li Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Li Wang @ 2026-03-31  9:44 UTC (permalink / raw)
  To: nathan, nsc, akpm, david, ljs, Liam.Howlett, vbabka, rppt, surenb,
	mhocko, shuah
  Cc: linux-mm, linux-kselftest, linux-kernel, linux-kbuild

Currently, the mm selftests build process can be quite noisy.

First, it leaks raw compiler errors during the liburing feature probe if
the headers are missing, which is confusing since the build system already
handles this gracefully with a clear warning.

Second, the specific 32-bit and 64-bit compilation targets ignore the
standard kbuild verbosity settings, always printing their full compiler
commands even during a default quiet build.

Notes:
  Andrew mentioned he hopes this patch merge into kbuild tree, so I resend
  to linux-kbuild@vger.kernel.org.

V2:

 - Drop 2/4, 3/4 from v1 to v2, since Andrew wasn't able to confirm the
   patch works for the rarely happening issue now, so I decided to just
   hand on the process of the parallel issue.

 - Refine the 4/4 patch only to hide compiler errors when missing liburing.

Li Wang (2):
  selftests/mm: respect build verbosity settings for 32/64-bit targets
  selftests/mm: suppress compiler error in liburing check

 tools/testing/selftests/mm/Makefile        | 9 ++++++---
 tools/testing/selftests/mm/check_config.sh | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

-- 
2.53.0



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

* [PATCH v2 1/2] selftests/mm: respect build verbosity settings for 32/64-bit targets
  2026-03-31  9:44 [PATCH v2 0/2] selftests/mm: clean up build output and verbosity Li Wang
@ 2026-03-31  9:44 ` Li Wang
  2026-03-31  9:44 ` [PATCH v2 2/2] selftests/mm: suppress compiler error in liburing check Li Wang
  2026-04-06 19:32 ` [PATCH v2 0/2] selftests/mm: clean up build output and verbosity Nathan Chancellor
  2 siblings, 0 replies; 5+ messages in thread
From: Li Wang @ 2026-03-31  9:44 UTC (permalink / raw)
  To: nathan, nsc, akpm, david, ljs, Liam.Howlett, vbabka, rppt, surenb,
	mhocko, shuah
  Cc: linux-mm, linux-kselftest, linux-kernel, linux-kbuild

The 32-bit and 64-bit compilation rules invoke $(CC) directly, bypassing
the $(Q) quiet prefix and $(call msg,...) helper used by the rest of the
selftests build system. This causes these rules to always print the full
compiler command line, even when V=0 (the default).

Wrap the commands with $(Q) and $(call msg,CC,,$@) to match the
convention used by lib.mk, so that quiet and verbose builds behave
consistently across all targets.

==== Build logs ====
  ...
  CC       merge
  CC       rmap
  CC       soft-dirty
  gcc -Wall -O2 -I /usr/src/25/tools/testing/selftests/../../..
                -isystem /usr/src/25/tools/testing/selftests/../../../usr/include
                -isystem /usr/src/25/tools/testing/selftests/../../../tools/include/uapi
                -Wunreachable-code -U_FORTIFY_SOURCE -no-pie -D_GNU_SOURCE=
                -I/usr/src/25/tools/testing/selftests/../../../tools/testing/selftests
                -m32 -mxsave  protection_keys.c vm_util.c thp_settings.c pkey_util.c
                -lrt -lpthread -lm -lrt -ldl -lm
                -o /usr/src/25/tools/testing/selftests/mm/protection_keys_32
  gcc -Wall -O2 -I /usr/src/25/tools/testing/selftests/../../..
                -isystem /usr/src/25/tools/testing/selftests/../../../usr/include
                -isystem /usr/src/25/tools/testing/selftests/../../../tools/include/uapi
                -Wunreachable-code -U_FORTIFY_SOURCE -no-pie -D_GNU_SOURCE=
                -I/usr/src/25/tools/testing/selftests/../../../tools/testing/selftests
                -m32 -mxsave  pkey_sighandler_tests.c vm_util.c thp_settings.c pkey_util.c
                -lrt -lpthread -lm -lrt -ldl -lm
                -o /usr/src/25/tools/testing/selftests/mm/pkey_sighandler_tests_32
  ...

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Li Wang <liwang@redhat.com>
Tested-by: Andrew Morton <akpm@linux-foundation.org>
---
 tools/testing/selftests/mm/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
index 7a5de4e9bf52..3b222cd6a048 100644
--- a/tools/testing/selftests/mm/Makefile
+++ b/tools/testing/selftests/mm/Makefile
@@ -215,7 +215,8 @@ ifeq ($(CAN_BUILD_I386),1)
 $(BINARIES_32): CFLAGS += -m32 -mxsave
 $(BINARIES_32): LDLIBS += -lrt -ldl -lm
 $(BINARIES_32): $(OUTPUT)/%_32: %.c
-	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@
+	$(call msg,CC,,$@)
+	$(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@
 $(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-32,$(t))))
 endif
 
@@ -223,7 +224,8 @@ ifeq ($(CAN_BUILD_X86_64),1)
 $(BINARIES_64): CFLAGS += -m64 -mxsave
 $(BINARIES_64): LDLIBS += -lrt -ldl
 $(BINARIES_64): $(OUTPUT)/%_64: %.c
-	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@
+	$(call msg,CC,,$@)
+	$(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@
 $(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-64,$(t))))
 endif
 
-- 
2.53.0



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

* [PATCH v2 2/2] selftests/mm: suppress compiler error in liburing check
  2026-03-31  9:44 [PATCH v2 0/2] selftests/mm: clean up build output and verbosity Li Wang
  2026-03-31  9:44 ` [PATCH v2 1/2] selftests/mm: respect build verbosity settings for 32/64-bit targets Li Wang
@ 2026-03-31  9:44 ` Li Wang
  2026-04-06 19:32 ` [PATCH v2 0/2] selftests/mm: clean up build output and verbosity Nathan Chancellor
  2 siblings, 0 replies; 5+ messages in thread
From: Li Wang @ 2026-03-31  9:44 UTC (permalink / raw)
  To: nathan, nsc, akpm, david, ljs, Liam.Howlett, vbabka, rppt, surenb,
	mhocko, shuah
  Cc: linux-mm, linux-kselftest, linux-kernel, linux-kbuild

When building the mm selftests on a system without liburing development
headers, check_config.sh leaks a raw compiler error:

  /tmp/tmp.kIIOIqwe3n.c:2:10: fatal error: liburing.h: No such file or directory
      2 | #include <liburing.h>
        |          ^~~~~~~~~~~~

Since this is an expected failure during the configuration probe,
redirect the compiler output to /dev/null to hide it.

And the build system prints a clear warning when this occurs:

  Warning: missing liburing support. Some tests will be skipped.

Because the user is properly notified about the missing dependency, the
raw compiler error is redundant and only confuse users.

Additionally, update the Makefile to use $(Q) and $(call msg,...) for
the check_config.sh execution. This aligns the probe with standard
kbuild output formatting, providing a clean "CHK" message instead of
printing the raw command during the build.

Signed-off-by: Li Wang <liwang@redhat.com>
---
 tools/testing/selftests/mm/Makefile        | 3 ++-
 tools/testing/selftests/mm/check_config.sh | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile
index 3b222cd6a048..2f6d2a207a0c 100644
--- a/tools/testing/selftests/mm/Makefile
+++ b/tools/testing/selftests/mm/Makefile
@@ -262,7 +262,8 @@ $(OUTPUT)/migration: LDLIBS += -lnuma
 $(OUTPUT)/rmap: LDLIBS += -lnuma
 
 local_config.mk local_config.h: check_config.sh
-	CC="$(CC)" CFLAGS="$(CFLAGS)" ./check_config.sh
+	$(call msg,CHK,config,$@)
+	$(Q)CC="$(CC)" CFLAGS="$(CFLAGS)" ./check_config.sh
 
 EXTRA_CLEAN += local_config.mk local_config.h
 
diff --git a/tools/testing/selftests/mm/check_config.sh b/tools/testing/selftests/mm/check_config.sh
index b84c82bbf875..32beaefe279e 100755
--- a/tools/testing/selftests/mm/check_config.sh
+++ b/tools/testing/selftests/mm/check_config.sh
@@ -16,7 +16,7 @@ echo "#include <sys/types.h>"        > $tmpfile_c
 echo "#include <liburing.h>"        >> $tmpfile_c
 echo "int func(void) { return 0; }" >> $tmpfile_c
 
-$CC $CFLAGS -c $tmpfile_c -o $tmpfile_o
+$CC $CFLAGS -c $tmpfile_c -o $tmpfile_o >/dev/null 2>&1
 
 if [ -f $tmpfile_o ]; then
     echo "#define LOCAL_CONFIG_HAVE_LIBURING 1"  > $OUTPUT_H_FILE
-- 
2.53.0



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

* Re: [PATCH v2 0/2] selftests/mm: clean up build output and verbosity
  2026-03-31  9:44 [PATCH v2 0/2] selftests/mm: clean up build output and verbosity Li Wang
  2026-03-31  9:44 ` [PATCH v2 1/2] selftests/mm: respect build verbosity settings for 32/64-bit targets Li Wang
  2026-03-31  9:44 ` [PATCH v2 2/2] selftests/mm: suppress compiler error in liburing check Li Wang
@ 2026-04-06 19:32 ` Nathan Chancellor
  2026-04-06 19:51   ` Andrew Morton
  2 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2026-04-06 19:32 UTC (permalink / raw)
  To: Li Wang
  Cc: nsc, akpm, david, ljs, Liam.Howlett, vbabka, rppt, surenb, mhocko,
	shuah, linux-mm, linux-kselftest, linux-kernel, linux-kbuild

On Tue, Mar 31, 2026 at 05:44:00PM +0800, Li Wang wrote:
> Currently, the mm selftests build process can be quite noisy.
> 
> First, it leaks raw compiler errors during the liburing feature probe if
> the headers are missing, which is confusing since the build system already
> handles this gracefully with a clear warning.
> 
> Second, the specific 32-bit and 64-bit compilation targets ignore the
> standard kbuild verbosity settings, always printing their full compiler
> commands even during a default quiet build.
> 
> Notes:
>   Andrew mentioned he hopes this patch merge into kbuild tree, so I resend
>   to linux-kbuild@vger.kernel.org.

Kbuild does not maintain anything in tools/, so this should go through
either the mm tree or the kselftests tree.

> V2:
> 
>  - Drop 2/4, 3/4 from v1 to v2, since Andrew wasn't able to confirm the
>    patch works for the rarely happening issue now, so I decided to just
>    hand on the process of the parallel issue.
> 
>  - Refine the 4/4 patch only to hide compiler errors when missing liburing.
> 
> Li Wang (2):
>   selftests/mm: respect build verbosity settings for 32/64-bit targets
>   selftests/mm: suppress compiler error in liburing check
> 
>  tools/testing/selftests/mm/Makefile        | 9 ++++++---
>  tools/testing/selftests/mm/check_config.sh | 2 +-
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> -- 
> 2.53.0
> 


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

* Re: [PATCH v2 0/2] selftests/mm: clean up build output and verbosity
  2026-04-06 19:32 ` [PATCH v2 0/2] selftests/mm: clean up build output and verbosity Nathan Chancellor
@ 2026-04-06 19:51   ` Andrew Morton
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2026-04-06 19:51 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Li Wang, nsc, david, ljs, Liam.Howlett, vbabka, rppt, surenb,
	mhocko, shuah, linux-mm, linux-kselftest, linux-kernel,
	linux-kbuild

On Mon, 6 Apr 2026 12:32:16 -0700 Nathan Chancellor <nathan@kernel.org> wrote:

> > Second, the specific 32-bit and 64-bit compilation targets ignore the
> > standard kbuild verbosity settings, always printing their full compiler
> > commands even during a default quiet build.
> > 
> > Notes:
> >   Andrew mentioned he hopes this patch merge into kbuild tree, so I resend
> >   to linux-kbuild@vger.kernel.org.
> 
> Kbuild does not maintain anything in tools/, so this should go through
> either the mm tree or the kselftests tree.

No probs.  Li, please send it along after -rc1?


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

end of thread, other threads:[~2026-04-06 19:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31  9:44 [PATCH v2 0/2] selftests/mm: clean up build output and verbosity Li Wang
2026-03-31  9:44 ` [PATCH v2 1/2] selftests/mm: respect build verbosity settings for 32/64-bit targets Li Wang
2026-03-31  9:44 ` [PATCH v2 2/2] selftests/mm: suppress compiler error in liburing check Li Wang
2026-04-06 19:32 ` [PATCH v2 0/2] selftests/mm: clean up build output and verbosity Nathan Chancellor
2026-04-06 19:51   ` Andrew Morton

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