cvs commit: src/share/man/man5 rc.conf.5 src/etc/rc.d Makefile
mdconfig mdconfig2
Dmitry Morozovsky
marck at rinet.ru
Tue Aug 22 14:16:59 UTC 2006
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 at rinet.ru ***
------------------------------------------------------------------------
More information about the cvs-src
mailing list