From owner-freebsd-questions@FreeBSD.ORG Mon Sep 3 07:07:40 2007 Return-Path: Delivered-To: freebsd-questions@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C256316A419; Mon, 3 Sep 2007 07:07:40 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from gaia.nimnet.asn.au (nimbin.lnk.telstra.net [139.130.45.143]) by mx1.freebsd.org (Postfix) with ESMTP id A899A13C4A8; Mon, 3 Sep 2007 07:07:37 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (smithi@localhost) by gaia.nimnet.asn.au (8.8.8/8.8.8R1.5) with SMTP id RAA01582; Mon, 3 Sep 2007 17:07:16 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Mon, 3 Sep 2007 17:07:15 +1000 (EST) From: Ian Smith To: Kris Kennaway In-Reply-To: <46DA9AC9.9090804@FreeBSD.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@FreeBSD.org Subject: Re: g_vfs write error = 28, bad memory? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2007 07:07:40 -0000 On Sun, 2 Sep 2007, Kris Kennaway wrote: > Ian Smith wrote: > > On Sat, 01 Sep 2007 19:34:41 +0200 Kris Kennaway 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