Date: Sun, 13 Mar 2011 11:47:37 +0200 From: Kostik Belousov <kostikbel@gmail.com> To: Doug Barton <dougb@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r219578 - head/etc Message-ID: <20110313094737.GD78089@deviant.kiev.zoral.com.ua> In-Reply-To: <201103122113.p2CLD8LO030205@svn.freebsd.org> References: <201103122113.p2CLD8LO030205@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--XXsWVrBycM1CuLu1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 12, 2011 at 09:13:08PM +0000, Doug Barton wrote: > Author: dougb > Date: Sat Mar 12 21:13:08 2011 > New Revision: 219578 > URL: http://svn.freebsd.org/changeset/base/219578 >=20 > Log: > Use the allexport option in load_rc_config() in order to avoid having > to repeatedly read the conf files. Depending on what is enabled the > files are being read anywhere from 15, 30, or more times currently. > By loading the values in the environment this is reduced to 1, with > perhaps a couple more, again depending on what is enabled. > =20 > The speed-up for boot and shutdown is negligible when rc.conf is > on local disk, noticable when accessing files over NFS, and dramatic > when pulling rc.conf values from a database. > =20 > This change also includes a minor optimization to the conditional > for $_rc_conf_loaded. >=20 > Modified: > head/etc/rc.subr >=20 > Modified: head/etc/rc.subr > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/etc/rc.subr Sat Mar 12 20:36:52 2011 (r219577) > +++ head/etc/rc.subr Sat Mar 12 21:13:08 2011 (r219578) > @@ -998,9 +998,8 @@ load_rc_config() > err 3 'USAGE: load_rc_config name' > fi > =20 > - if ${_rc_conf_loaded:-false}; then > - : > - else > + if [ -z "$_rc_conf_loaded" ]; then > + set -o allexport > if [ -r /etc/defaults/rc.conf ]; then > debug "Sourcing /etc/defaults/rc.conf" > . /etc/defaults/rc.conf > @@ -1010,6 +1009,7 @@ load_rc_config() > . /etc/rc.conf > fi > _rc_conf_loaded=3Dtrue > + set +o allexport > fi > if [ -f /etc/rc.conf.d/"$_name" ]; then > debug "Sourcing /etc/rc.conf.d/${_name}" As I read it, the change means that each process started by rc.d got approximately 32kB of non-shared garbage data in its environment ? --XXsWVrBycM1CuLu1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk18krgACgkQC3+MBN1Mb4i9zgCgqsp/UixH81Sek2nWAKqQSs7k dAsAn36JkA6VJ7BDrgBFaXKKE+9XVFi0 =sqcF -----END PGP SIGNATURE----- --XXsWVrBycM1CuLu1--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110313094737.GD78089>