md /tmp and async mounts
Giorgos Keramidas
keramida at freebsd.org
Wed May 31 17:24:31 PDT 2006
On 2006-05-24 23:46, Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
> AFAIK, only /etc/rc.d/tmp and /etc/rc.d/var use the mount_md() function
> from `rc.subr'. I think `/etc/rc.initdiskless' includes a local version
> of mount_md() and uses that one.
>
> On 2006-05-24 16:37, Kris Kennaway <kris at obsecurity.org> wrote:
> > On Wed, May 24, 2006 at 11:36:45PM +0300, Giorgos Keramidas wrote:
> > > If that is so, do you want me to make the change, or do you want to do
> > > this?
> >
> > I don't have a good idea of what needs to be changed to do all of the
> > above, so if you're familiar with the code you might as well do it.
>
> I can certainly prepare a patch for /etc/rc.d/* files and their
> manpages. I'll post it for review then :)
The following diff should be sufficient for enabling -o async for
the MFS /tmp and MFS /var filesystems we support in our current
rc.d stuff:
%%%
Index: share/man/man5/rc.conf.5
===================================================================
--- share/man/man5/rc.conf.5 (revision 99)
+++ share/man/man5/rc.conf.5 (revision 101)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.298 2006/05/30 16:20:48 matteo Exp $
.\"
-.Dd May 29, 2006
+.Dd Jun 1, 2006
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -241,12 +241,13 @@
.Pa /tmp
is created.
The default is
-.Dq Li "-S -M" ,
+.Dq Li "-S -M -o async" ,
which inhibits the use of softupdates on
.Pa /tmp
to waste as little space as possible
-and creates a pure memory backed disk, which will never be swapped out,
-for maximum performance and system stability at low memory conditions.
+and creates a pure memory-backed disk, which uses asynchronous I/O
+and will never be swapped out, for maximum performance and system
+stability at low memory conditions.
See
.Xr mdmfs 8
for other options you can use in
@@ -273,12 +274,13 @@
.Pa /var
is created.
The default is
-.Dq Li "-S -M" ,
+.Dq Li "-S -M -o async" ,
which inhibits the use of softupdates on
.Pa /var
to waste as little space as possible
-and creates a pure memory backed disk, which will never be swapped out,
-for maximum performance and system stability at low memory conditions.
+and creates a pure memory-backed disk, which uses asynchronous I/O
+and will never be swapped out, for maximum performance and system
+stability at low memory conditions.
See
.Xr mdmfs 8
for other options you can use in
Index: etc/defaults/rc.conf
===================================================================
--- etc/defaults/rc.conf (revision 99)
+++ etc/defaults/rc.conf (revision 101)
@@ -43,10 +43,10 @@
removable_route_flush="YES" # 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 -M -o async" # 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 -M -o async" # 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.
%%%
This doesn't make 'async' the default for all mdmfs mounts.
Making async the default for mdmfs-based filesystems would
require a fair bit of changes to mdmfs, which would have to grow
mount-option parsing capabilities for the `optarg' of the -o
option and make sure that async is always added, unless mdmfs is
called explicitly with `noasync' in its -o option.
Having said this, if this is considered a change we should make,
I can prepare a patch for mdmfs too.
- Giorgos
More information about the freebsd-current
mailing list