Date: Tue, 22 Aug 2006 18:16:53 +0400 (MSD) From: Dmitry Morozovsky <marck@rinet.ru> To: Kris Kennaway <kris@obsecurity.org> Cc: cvs-src@freebsd.org, src-committers@freebsd.org, Florent Thoumie <flz@freebsd.org>, cvs-all@freebsd.org, Wes Peters <wes@opensail.org> Subject: Re: cvs commit: src/share/man/man5 rc.conf.5 src/etc/rc.d Makefile mdconfig mdconfig2 Message-ID: <20060822181126.N27449@woozle.rinet.ru> In-Reply-To: <20060822094426.GA48626@xor.obsecurity.org> References: <200608211506.k7LF6cJH001832@repoman.freebsd.org> <1DE9D506-0C4B-4CE7-8944-DC4C8AE640C7@opensail.org> <20060822094353.GB48419@xor.obsecurity.org> <20060822094426.GA48626@xor.obsecurity.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 22 Aug 2006, Kris Kennaway wrote:
KK> > > > Use should be as easy as:
KK> > > >
KK> > > > mdconfig_md0="-t malloc -s 10m"
KK> >
KK> > We should consider adding "-o reserve" to malloc-backed md creation
KK> > where applicable (e.g. the md-backed /tmp creation) to avoid bogus PRs
KK> > from people who run their kernels out of memory by filling up /tmp.
KK>
KK> Oops, I forgot they were already (correctly) fixed to use swap backing
KK> (I think).
Not yet, the default is still -M. I had a patch for this, based on vm.nswapdev
value, to use malloc-backed md only on swapless machines:
Index: rc.subr
===================================================================
RCS file: /home/ncvs/src/etc/rc.subr,v
retrieving revision 1.68
diff -u -r1.68 rc.subr
--- rc.subr 22 Aug 2006 11:17:28 -0000 1.68
+++ rc.subr 22 Aug 2006 14:15:36 -0000
@@ -1332,6 +1332,9 @@
if [ -n "$3" ]; then
flags="$3"
fi
+ if [ `${SYSCTL_N} vm.nswapdev` = 0 ]; then
+ flags="-M $flags"
+ fi
/sbin/mdmfs $flags -s $1 md $2
}
Index: defaults/rc.conf
===================================================================
RCS file: /home/ncvs/src/etc/defaults/rc.conf,v
retrieving revision 1.294
diff -u -r1.294 rc.conf
--- defaults/rc.conf 17 Aug 2006 20:13:24 -0000 1.294
+++ defaults/rc.conf 22 Aug 2006 14:16:09 -0000
@@ -43,10 +43,10 @@
removable_route_flush="NO" # Flush routes when removing an interface
tmpmfs="AUTO" # Set to YES to always create an mfs /tmp, NO to never
tmpsize="20m" # Size of mfs /tmp if created
-tmpmfs_flags="-S -M" # Extra mdmfs options for the mfs /tmp
+tmpmfs_flags="-S" # Extra mdmfs options for the mfs /tmp
varmfs="AUTO" # Set to YES to always create an mfs /var, NO to never
varsize="32m" # Size of mfs /var if created
-varmfs_flags="-S -M" # Extra mount options for the mfs /var
+varmfs_flags="-S" # Extra mount options for the mfs /var
populate_var="AUTO" # Set to YES to always (re)populate /var, NO to never
cleanvar_enable="YES" # Clean the /var directory
local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs.
Sincerely,
D.Marck [DM5020, MCK-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060822181126.N27449>
