From patchwork Tue Aug 13 21:45:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 34075 Received: (qmail 93261 invoked by alias); 13 Aug 2019 21:45:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 93126 invoked by uid 89); 13 Aug 2019 21:45:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=ghz, GHz X-HELO: mx1.redhat.com Date: Tue, 13 Aug 2019 17:45:09 -0400 Message-Id: From: DJ Delorie To: libc-alpha@sourceware.org Subject: [patch v1] nptl: smarter not-parallel-ing On my i7-4790K (4 real, 8 HT, 4.0 GHz) machine, this reduces "make -j8 check" time from 15m36 to 15m10, saving 26 seconds. From 722d522f3145736fced14a2f7b57adfb8ecc2f30 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Tue, 13 Aug 2019 17:34:55 -0400 Subject: Optimize nptl test sequencing. Remove .NOTPARALLEL, which forces tests to be *built* in series. Replace with order-only dependencies between targets which only affects the tests themselves. diff --git a/ChangeLog b/ChangeLog index 71b254158d..12c3ef0dbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-08-13 DJ Delorie + + * nptl/Makefile (.NOTPARALLEL): Remove. Replace with computed + sequence dependencies instead. + 2019-08-13 Florian Weimer * login/utmp_file.c (LOCK_FILE, LOCKING_FAILED, UNLOCK_FILE): diff --git a/nptl/Makefile b/nptl/Makefile index 0567e77a79..d7a3857c95 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -666,7 +666,7 @@ $(objpfx)tst-cleanup0.out: /dev/null $(objpfx)tst-cleanup0 $(evaluate-test) $(objpfx)tst-cleanup0-cmp.out: tst-cleanup0.expect $(objpfx)tst-cleanup0.out - cmp $^ > $@; \ + cmp tst-cleanup0.expect $(objpfx)tst-cleanup0.out > $@; \ $(evaluate-test) $(objpfx)crti.o: $(objpfx)pt-crti.o @@ -723,7 +723,23 @@ tst-audit-threads-ENV = LD_AUDIT=$(objpfx)tst-audit-threads-mod1.so CFLAGS-tst-unwind-thread.c += -funwind-tables -# The tests here better do not run in parallel -ifneq ($(filter %tests,$(MAKECMDGOALS)),) -.NOTPARALLEL: +ifeq ($(run-built-tests),yes) +# The tests in this subdir should not be run in parallel. +# +# The following will create rules like "foo2.out :| foo1.out" for all +# tests, which forces the tests to be run serially, but does not force +# a test to be run just because some other test was run. +# +# Caveat: the :|-style dependencies won't be listed in $^, so avoid +# using $^ to depend on test result files. + +ALLTESTS = $(tests:%=$(objpfx)%.out) $(tests-internal:%=$(objpfx)%.out) \ + $(tests-container:%=$(objpfx)%.out) \ + $(tests-special) $(tests-printers-out) \ + $(xtests:%=$(objpfx)%.out) $(xtests-special) + +ALLBUTFIRSTTEST = $(filter-out $(firstword $(ALLTESTS)), $(ALLTESTS)) +ALLBUTLASTTEST = $(filter-out $(lastword $(ALLTESTS)), $(ALLTESTS)) +TESTPAIRS = $(join $(ALLBUTFIRSTTEST),$(addprefix :|,$(ALLBUTLASTTEST))) +$(foreach pair,$(TESTPAIRS),$(eval $(pair))) endif