From owner-dev-commits-src-main@freebsd.org Wed Feb 24 09:20:49 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5958556821; Wed, 24 Feb 2021 09:20:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dlr4d5Wjkz4jLr; Wed, 24 Feb 2021 09:20:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (unknown [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 6A21A85EB; Wed, 24 Feb 2021 09:20:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id CC3C53314C; Wed, 24 Feb 2021 10:20:47 +0100 (CET) Date: Wed, 24 Feb 2021 10:20:47 +0100 From: Baptiste Daroussin To: Cy Schubert Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot Message-ID: <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <202102240105.11O15bKn096987@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7stizekjxx47ph24" Content-Disposition: inline In-Reply-To: <202102240105.11O15bKn096987@slippy.cwsent.com> X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2021 09:20:50 -0000 --7stizekjxx47ph24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 23, 2021 at 05:05:37PM -0800, Cy Schubert wrote: > In message <202102231027.11NARYYE041280@gitrepo.freebsd.org>, Baptiste=20 > Daroussi > n writes: > > The branch main has been updated by bapt: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D77e1ccbee3ed6c837929e4e2= 32fd07f9 > > 5bfc8294 > > > > commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 > > Author: Rick Parrish > > AuthorDate: 2021-02-07 06:15:21 +0000 > > Commit: Baptiste Daroussin > > CommitDate: 2021-02-23 10:16:53 +0000 > > > > rc: implement parallel boot > > =20 > > take advantage of the rcorder -p argument to implement parallel > > booting in rc. > > =20 > > According to the author non scientific tests: > > on a Core 2 Duo with spinning disk: > > =20 > > | Services enabled | before | after | saving | > > | 0 | 8s | 8s | 0 | > > | 1 | 13s | 13s | 0 | > > | 2 | 17s | 13s | 5 | > > | 3 | 23s | 13s | 10 | > > | 4 | 28s | 13s | 15 | > > | 5 | 33s | 13s | 20 | > > =20 > > PR: 249192 > > MFC after: 3 weeks > > --- > > libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- > > 1 file changed, 34 insertions(+), 15 deletions(-) > > > > diff --git a/libexec/rc/rc b/libexec/rc/rc > > index 35db4a850516..722d7fe35884 100644 > > --- a/libexec/rc/rc > > +++ b/libexec/rc/rc > > @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then > > skip_firstboot=3D"-s firstboot" > > fi > > =20 > > +# rc_parallel_start default is "NO" > > +rc_parallel_start=3D${rc_parallel_start:-NO} > > +_rc_parallel=3D'' > > +# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES" > > +checkyesno rc_parallel_start && _rc_parallel=3D'-p' > > + > > # Do a first pass to get everything up to $early_late_divider so that > > # we can do a second pass that includes $local_startup directories > > # > > -files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` > > +files=3D`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/*= 2>/dev/ > > null` > > =20 > > _rc_elem_done=3D' ' > > -for _rc_elem in ${files}; do > > - run_rc_script ${_rc_elem} ${_boot} > > - _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > > - > > - case "$_rc_elem" in > > - */${early_late_divider}) break ;; > > - esac > > +IFS=3D$'\n' > > +for _rc_group in ${files}; do > > + IFS=3D$' ' > > + for _rc_elem in ${_rc_group}; do > > + run_rc_script ${_rc_elem} ${_boot} & > > + _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > > + > > + case "$_rc_elem" in > > + */${early_late_divider}) break ;; > > + esac > > + done > > + wait > > + IFS=3D$'\n' > > done > > =20 > > unset files local_rc > > @@ -122,14 +134,21 @@ if [ -e ${firstboot_sentinel} ]; then > > skip_firstboot=3D"" > > fi > > =20 > > -files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/= dev/null > > ` > > -for _rc_elem in ${files}; do > > - case "$_rc_elem_done" in > > - *" $_rc_elem "*) continue ;; > > - esac > > - > > - run_rc_script ${_rc_elem} ${_boot} > > +files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_= rc_paral > > lel} 2>/dev/null` > > +IFS=3D$'\n' > > +for _rc_group in ${files}; do > > + IFS=3D$' ' > > + for _rc_elem in ${_rc_group}; do > > + case "$_rc_elem_done" in > > + *" $_rc_elem "*) continue ;; > > + esac > > + > > + run_rc_script ${_rc_elem} ${_boot} & > > + done > > + wait > > + IFS=3D$'\n' > > done > > +unset IFS > > =20 > > # Remove the firstboot sentinel, and reboot if it was requested. > > # Be a bit paranoid about removing it to handle the common failure > > >=20 > Since this commit my postfix, dovecot and nut fail to start at boot, and= =20 > must be started by hand. >=20 >=20 I cannot reproduce, what failure do you have?=20 Best regards, Bapt --7stizekjxx47ph24 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAmA2Gm0ACgkQY4mL3PG3 PlrMXA//QhyZ/eSQO/bykVc21yMPOaArRUOC10a7zApG/cVNu8PXzAMG7eFGgP11 Vv915uEtquHuALMBfzqmE6Ujf/XIi/xr7odJvFFYo9zmzKP74wBir4uGg6JfDlYV OQzwoxJGV/qUuA1d3pqDUUlCsFWN2M//9Six78sy09Dn098GsTb8DadE0L9HA+HW wh321Wa8aqLgHVZcwQgNsPtRqUaJY3TIOTAigI609tbN+VehzFoxRg9g7yIFIKoD 1ANRkHEGWsGMF2mtVQwutIsuF0Vm+ScQY3An7xuF7rw42YsxZo3jljhrx1znttg5 VziKWO5viDJo460qv9ex6loVqcW/JBfO8rUpQQHu1mY7/dK0uASczMTHKORnkUz3 03ZCA8beO3Bh1VY/Lv5DQaQia5OTM2I00636EayncHmnvocdXzHW7FZw/00xM02K WguZ+xyN9KJ2GLLKirkyuSmIuemh1+HU3EjWZF3GZV7MJwf/zIaUrR2+jFnjTLiI EXOxzVf7KE/k6eVIrLBtXFg1J95l3i7Brk7f6Rh3arQRLTran8LAlIlkqljP/nLp JWs2Bcp7cY9OoQH2EDN5kPkXylZr9ZkHrzBuxt3661NAFpl5zCtzo+PsV5zaMYKj XA1moNFLy5F0hogmyDtVSQJXpxg2LzjN7iesTAP3ibgMnntYVlo= =Zxua -----END PGP SIGNATURE----- --7stizekjxx47ph24--