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: 1146680 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-104384-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="P1M8oRN8"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 467R9171psz9sML for ; Wed, 14 Aug 2019 07:45:41 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:subject; q=dns; s= default; b=ZJbbvYNT09BATKGZAw51cM5Bi9oeehrVgOhSwautyy3yVJ4ur99MO b4mJuXYIaCgpZdXmVsLbKzsZp2xI0PVHmQzgRMUMkO6iOUGCpB+tIph3UfzXMmHk /+S9Yyi4yxpv1edsNzLIb8UkKAhYZkQkAf4408ytklwASXEoYP2Q+c= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:message-id:from:to:subject; s=default; bh=KjVYmR+/fiqXMpo5eyHjdJ22Jjk=; b=P1M8oRN89MncnCap7xmPXtgCEV/g RbjwR+xXzBg5LLo44K8u5fUh8tAndEDhLwo7wVY5qcsGPEOpT/1EVwXJVjQU57KE EynB+Dzcp5ALOICxhFix0tYA4Aaw2gMjXbnvUo7CZLH6HNTkUYcfjGZBDCn9yagF Q8hXkpPEj1XJpvY= 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