From owner-freebsd-smp Sun Nov 2 10:45:56 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA05928 for smp-outgoing; Sun, 2 Nov 1997 10:45:56 -0800 (PST) (envelope-from owner-freebsd-smp) Received: from mail.cs.tu-berlin.de (root@mail.cs.tu-berlin.de [130.149.17.13]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA05919 for ; Sun, 2 Nov 1997 10:45:45 -0800 (PST) (envelope-from wosch@cs.tu-berlin.de) Received: from panke.panke.de (anonymous221.ppp.cs.tu-berlin.de [130.149.17.221]) by mail.cs.tu-berlin.de (8.8.6/8.8.7) with ESMTP id TAA16318; Sun, 2 Nov 1997 19:42:03 +0100 (MET) Received: (from wosch@localhost) by panke.panke.de (8.8.5/8.6.12) id SAA00510; Sun, 2 Nov 1997 18:21:50 +0100 (MET) To: "Jordan K. Hubbard" Cc: Wolfram Schneider , smp@freebsd.org Subject: Re: Some SMP timing tests. References: <5168.878410338@time.cdrom.com> From: Wolfram Schneider Date: 02 Nov 1997 18:21:48 +0100 In-Reply-To: "Jordan K. Hubbard"'s message of Sat, 01 Nov 1997 10:52:18 -0800 Message-ID: Lines: 171 Sender: owner-freebsd-smp@freebsd.org X-Loop: FreeBSD.org Precedence: bulk "Jordan K. Hubbard" writes: > > If you have a Makefile with 5 targets (e.g. 4 *.c files, 1 manpage), > > make can only create 5 jobs at once. Not surprising ;-) > > A good point, but this doesn't quite explain the behavior during > compiling things like libc, which has many targets which could be > parallelized. The bottleneck is the SUBDIR target which is not parallelized. Try the patch and run `make -j -I share/mk all' in /usr/src. The patch split the SUBDIR variable into 4 variables SUBDIR1, ... SUBDIR4 and runs 4 subdir targets simultaneously. Index: Makefile =================================================================== RCS file: /usr/cvs/src/Makefile,v retrieving revision 1.155 diff -u -r1.155 Makefile --- Makefile 1997/10/10 13:02:36 1.155 +++ Makefile 1997/11/02 11:32:56 @@ -39,6 +39,11 @@ # Put initial settings here. SUBDIR= +SUBDIR1= +SUBDIR2= +SUBDIR3= +SUBDIR4= + # We must do share/info early so that installation of info `dir' # entries works correctly. Do it first since it is less likely to @@ -50,52 +55,52 @@ # We must do include and lib early so that the perl *.ph generation # works correctly as it uses the header files installed by this. .if exists(include) -SUBDIR+= include +SUBDIR2+= include .endif .if exists(lib) -SUBDIR+= lib +SUBDIR2+= lib .endif .if exists(bin) -SUBDIR+= bin +SUBDIR3+= bin .endif .if exists(games) && !defined(NOGAMES) -SUBDIR+= games +SUBDIR1+= games .endif .if exists(gnu) -SUBDIR+= gnu +SUBDIR1+= gnu .endif .if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS4) -SUBDIR+= kerberosIV +SUBDIR2+= kerberosIV .endif .if exists(libexec) -SUBDIR+= libexec +SUBDIR2+= libexec .endif .if exists(sbin) -SUBDIR+= sbin +SUBDIR4+= sbin .endif .if exists(share) && !defined(NOSHARE) -SUBDIR+= share +SUBDIR3+= share .endif .if exists(sys) -SUBDIR+= sys +SUBDIR4+= sys .endif .if exists(usr.bin) -SUBDIR+= usr.bin +SUBDIR3+= usr.bin .endif .if exists(usr.sbin) -SUBDIR+= usr.sbin +SUBDIR4+= usr.sbin .endif .if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE) -SUBDIR+= secure +SUBDIR2+= secure .endif .if exists(lkm) && !defined(NOLKM) -SUBDIR+= lkm +SUBDIR4+= lkm .endif # etc must be last for "distribute" to work .if exists(etc) && make(distribute) -SUBDIR+= etc +SUBDIR4+= etc .endif # These are last, since it is nice to at least get the base system Index: share/mk/bsd.subdir.mk =================================================================== RCS file: /usr/cvs/src/share/mk/bsd.subdir.mk,v retrieving revision 1.18 diff -u -r1.18 bsd.subdir.mk --- bsd.subdir.mk 1997/06/21 15:40:34 1.18 +++ bsd.subdir.mk 1997/11/02 11:29:28 @@ -46,7 +46,57 @@ cd ${.CURDIR}/$${edir}; \ fi; \ ${MAKE} ${.TARGET:realinstall=install} DIRPRFX=${DIRPRFX}$$edir/); \ - done + done; \ + for entry in ${SUBDIR1}; do \ + (if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ + ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE}"; \ + edir=$${entry}.${MACHINE}; \ + cd ${.CURDIR}/$${edir}; \ + else \ + ${ECHODIR} "===> ${DIRPRFX}$$entry"; \ + edir=$${entry}; \ + cd ${.CURDIR}/$${edir}; \ + fi; \ + ${MAKE} ${.TARGET:realinstall=install} DIRPRFX=${DIRPRFX}$$edir/); \ + done & \ + for entry in ${SUBDIR2}; do \ + (if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ + ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE}"; \ + edir=$${entry}.${MACHINE}; \ + cd ${.CURDIR}/$${edir}; \ + else \ + ${ECHODIR} "===> ${DIRPRFX}$$entry"; \ + edir=$${entry}; \ + cd ${.CURDIR}/$${edir}; \ + fi; \ + ${MAKE} ${.TARGET:realinstall=install} DIRPRFX=${DIRPRFX}$$edir/); \ + done & \ + for entry in ${SUBDIR3}; do \ + (if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ + ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE}"; \ + edir=$${entry}.${MACHINE}; \ + cd ${.CURDIR}/$${edir}; \ + else \ + ${ECHODIR} "===> ${DIRPRFX}$$entry"; \ + edir=$${entry}; \ + cd ${.CURDIR}/$${edir}; \ + fi; \ + ${MAKE} ${.TARGET:realinstall=install} DIRPRFX=${DIRPRFX}$$edir/); \ + done & \ + for entry in ${SUBDIR}; do \ + (if test -d ${.CURDIR}/$${entry}.${MACHINE}; then \ + ${ECHODIR} "===> ${DIRPRFX}$${entry}.${MACHINE}"; \ + edir=$${entry}.${MACHINE}; \ + cd ${.CURDIR}/$${edir}; \ + else \ + ${ECHODIR} "===> ${DIRPRFX}$$entry"; \ + edir=$${entry}; \ + cd ${.CURDIR}/$${edir}; \ + fi; \ + ${MAKE} ${.TARGET:realinstall=install} DIRPRFX=${DIRPRFX}$$edir/); \ + done & \ + wait + ${SUBDIR}:: @if test -d ${.TARGET}.${MACHINE}; then \ -- Wolfram Schneider http://www.apfel.de/~wosch/