Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Dec 2005 11:51:10 +1030
From:      Kris Kennaway <kris@obsecurity.org>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        James Long <list@museum.rain.com>, freebsd-questions@freebsd.org
Subject:   Re: Reboots under 6.0 while exercising md device
Message-ID:  <43ACA286.9040403@obsecurity.org>
In-Reply-To: <20051223002251.GA24821@odin.ac.hmc.edu>
References:  <20051222035049.GA25222@ns.museum.rain.com>	<20051222043519.GA4610@odin.ac.hmc.edu>	<20051223001102.GA32544@ns.museum.rain.com> <20051223002251.GA24821@odin.ac.hmc.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Brooks Davis wrote:

> On Thu, Dec 22, 2005 at 04:11:02PM -0800, James Long wrote:
> 
>>On Wed, Dec 21, 2005 at 08:35:19PM -0800, Brooks Davis wrote:
>>
>>>On Wed, Dec 21, 2005 at 07:50:49PM -0800, James Long wrote:
>>
>>[snip]
>>
>>>>What do I need to fix to be able to use a RAM-backed filesystem?
>>>
>>>From mdconfig(8):
>>>
>>>     -t type
>>>             Select the type of the memory disk.
>>>
>>>             malloc   Storage for this type of memory disk is allocated with
>>>                      malloc(9).  This limits the size to the malloc bucket
>>>                      limit in the kernel.  If the -o reserve option is not
>>>                      set, creating and filling a large malloc-backed memory
>>>                      disk is a very easy way to panic a system.
>>>
> 
> It allocates kernel address space which is quite scarce on 32-bit
> platforms.  I'm not sure if it allocated physical memory.  Given the
> panicking behavior, I suspect that is deferred.

Yes, that's why -o reserve is recommended to allocate it all up-front.

> I believe this is mostly accurate.  If you're actually out of memory,
> there's a good chance you're going to be swapping anyway so this might
> or might not actually cost you anything.  If you have frequent, randomly
> distributed access to the file system it's likely to be expensive.  On
> the other hand, if there are hot spots, the swapping may be beneficial
> because it will allow other processes to proceed more efficiently.

Also in the case when you are not swapping, swap-backed md is actually 
faster than malloc backed.

Really you need to make sure that whatever you use your system for, you 
have enough RAM that you never need to swap.  Otherwise you're throwing 
away most of your system's performance for no good reason.

Kris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43ACA286.9040403>