Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Sep 2007 17:07:15 +1000 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        Kris Kennaway <kris@FreeBSD.org>
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: g_vfs write error = 28, bad memory?
Message-ID:  <Pine.BSF.3.96.1070903152321.26352B-100000@gaia.nimnet.asn.au>
In-Reply-To: <46DA9AC9.9090804@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2 Sep 2007, Kris Kennaway wrote:
 > Ian Smith wrote:
 > > On Sat, 01 Sep 2007 19:34:41 +0200 Kris Kennaway <kris@FreeBSD.org> wrote:
 > >  > Per olof Ljungmark wrote:
[..]
 > >  > > amavisd_enable="YES"
 > >  > > amavisd_ram="512m"
 > >  > > 
 > >  > > and the line in rc.d/amavisd
 > >  > > mdmfs -M -s ${amavisd_ram} -w vscan:vscan md /var/amavis/tmp || true
 > >  > > for some reason creates a malloc based mfs
 > >  > > 
 > >  > > Perhaps I should check this with the maintainer...
 > >  > > 
 > >  > > 
 > >  > 
 > >  > Yes, malloc backing for md should be used in almost no situations.
 > > 
 > > Am I right in thinking such situations would then be limited to diskless
 > > / flashdisk / embedded systems having no swap?  Seems obvious, but ..
 > 
 > Sort of.  Swap backing will still work when you have no swap, and it's 
 > still faster than malloc backing.  The problem is that I think backing 
 > store reservation ("-o reserve") doesn't work unless you have actual 
 > swap to back everything, whereas with malloc backing it reserves in 
 > memory.  This means that it is easy to overcommit memory and the system 
 > will probably panic when it suddenly finds no free memory for the md (as 
 > in the original email).

Ah.  Swap backing with no swap configured sounded oxymoronic, and I was
confused and left guessing by md(4) on 5.5-STABLE (March) till checking: 
http://www.freebsd.org/cgi/man.cgi?query=md&apropos=0&sektion=0&manpath=FreeBSD+7-current&format=html
which explains swap backed operation in one short but crucial sentence.

But is running out of memory with swap-backed md (with no swap) likely
to be any prettier than the panics from (unreserved) malloc backing?

 > Ideally if no swap was configured, swap backing would also reserve the 
 > space in memory, and then I am not aware of any other reasons to 
 > continue using malloc backing.

By 'ideally' I guess you mean that it doesn't, yet?  I hope to get a
Soekris 4801 before too long, which will provide a chance to experiment
(though I'll likely run it from one of my old 4GB laptop drives anyway).

Also noted in passing: the 'auto' parameter to bsdlabel(8) used by one
mdconfig(8) example is undocumented, though supported in bsdlabel.c

Thanks,

Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.1070903152321.26352B-100000>