From owner-freebsd-toolchain@FreeBSD.ORG Thu Feb 13 17:23:27 2014 Return-Path: Delivered-To: freebsd-toolchain@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3551CDC; Thu, 13 Feb 2014 17:23:26 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC7781B3A; Thu, 13 Feb 2014 17:23:26 +0000 (UTC) Received: from [172.29.0.16] ([66.129.239.12]) (authenticated bits=0) by mail.xcllnt.net (8.14.7/8.14.7) with ESMTP id s1DHNO0x007756 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 13 Feb 2014 09:23:25 -0800 (PST) (envelope-from marcel@xcllnt.net) Content-Type: multipart/signed; boundary="Apple-Mail=_4FB6C4C3-8A32-4F93-9855-15BDD6B701C2"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: bmake(1) "sometimes" honors '-j' ? From: Marcel Moolenaar In-Reply-To: <20140209213618.GA63417@glenbarber.us> Date: Thu, 13 Feb 2014 09:23:19 -0800 Message-Id: <2510126A-ECD7-4DC7-A936-23824B233821@xcllnt.net> References: <20140209213618.GA63417@glenbarber.us> To: Glen Barber X-Mailer: Apple Mail (2.1827) Cc: freebsd-toolchain@FreeBSD.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Feb 2014 17:23:27 -0000 --Apple-Mail=_4FB6C4C3-8A32-4F93-9855-15BDD6B701C2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Feb 9, 2014, at 1:36 PM, Glen Barber wrote: > Maybe there is an obvious answer to this, or maybe I just do not > understand how computers work. >=20 > For snapshot builds for RPI-B and BEAGLEBONE, I am hard-coding '-j10' > for buildworld and '-j6' for buildkernel, because these values are > somewhat "safe" considering various race conditions with high '-j' > values. Crochet sets the '-j' value to '1', if WORLDJOBS and > KERNJOBS are not set, so what I end up with is basically: > 'make [...] -j10 -j1 ${.TARGET}'. >=20 > What I see in ps(1) is a bit confusing to me, though. >=20 > For example, the following suggests '-j10' is being honored for the > 'libraries' target, but '-j1' is being forced for the 'buildworld' > target, and I'm not sure I understand why. (Lines broken up for > readability.) >=20 > root@grind:~ # ps auxww | grep make | grep 'j' >=20 > root 67766 0.0 0.0 9024 1048 4 S+ 7:20PM 0:03.02 = make > TARGET_ARCH=3Darmv6 SRCCONF=3D/dev/null __MAKE_CONF=3D/dev/null -j10 = -j 1 buildworld >=20 > root 13112 0.0 0.0 9024 1488 4 S 8:24PM 0:00.94 = make > -j10 -f Makefile.inc1 DESTDIR=3D/usr/obj/arm.armv6/usr/src/tmp = -DNO_FSCHG > -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN -DNO_PROFILE > -DNO_TESTS libraries >=20 > So, if I am reading this correctly, the 'libraries' target is honoring > the '-j10', and 'buildworld' is honoring the later-specified '-j1'. >=20 > Am I reading this incorrectly, or is this something I just do not > understand about our toolchain? I can't give an authoritative answer, but there are a few things to consider: 1. MAKEFLAGS is set by make(1) for later use. There's also the .MAKEFLAGS variant. I don't know the *exact* difference between them, but our makefile, including Makefile.inc1, uses the variable and passes it to sub-makes. 2. make/bmake itself sets MAKEFLAGS/.MAKEFLAGS and automatically passes it to sub-makes. So when a makefile sets it, it's to override the default. 3. The .MAKEFLAGS variable holds the exact set of options passed to make. For example: % make -j10 -j1 -V .MAKEFLAGS -j 10 -j 1 -V .MAKEFLAGS What this means is that -j10 gets passed around and as such can be used, not withstanding the fact that -j1 follows and make itself may use that instead. Point 1 above applies. For best results, pass only 1 -j flag or alternatively we need to fix our makefiles to only keep the last -j in MAKEFLAGS, etc. HTH, --=20 Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_4FB6C4C3-8A32-4F93-9855-15BDD6B701C2 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlL8/4cACgkQpgWlLWHuifYkAgCfQfo0GOUJw+V/EwFgtOlRgJkd ytYAnROn9MWmCsL+3dNWghI5e4zG8eWo =aqza -----END PGP SIGNATURE----- --Apple-Mail=_4FB6C4C3-8A32-4F93-9855-15BDD6B701C2--