On FreeBSD 7.3-STABLE I'm mounting a DVD and doing something like this: mdconfig -a -t vnode -o reserve -o readonly -f /dvd/file so that /dvd/file becomes the backing storage for my memory disk. Now if the system is under severe memory pressure, will this memory get swapped out, causing a read from the DVD? How would I tell the system to never swap this file out of ram, even under severe memory pressure? The idea is to load this backing storage once and only once from the DVD into memory and leave it there. Thanks in advance. -- Dave Hayes - Consultant - Altadena CA, USA - dave@jetcafe.org>>> The opinions expressed above are entirely my own <<<Have you noticed how economical the human race is with it's idols? It sets them up, enjoys them, then falls upon them and devours them until nothing is left. Even the complete consumption of the idol, if it is another human being, is not the end. There are then hundreds of years worth of argument and analysis to be worked through...
On Thu, May 27, 2010 at 4:48 PM, Dave Hayes <dave@jetcafe.org> wrote:> On FreeBSD 7.3-STABLE I'm mounting a DVD and doing something like > this: > > ?mdconfig -a -t vnode -o reserve -o readonly -f /dvd/file > > so that /dvd/file becomes the backing storage for my memory > disk. > > Now if the system is under severe memory pressure, will this > memory get swapped out, causing a read from the DVD?What swap? Need more details...> How would I tell the system to never swap this file out of ram, even under > severe memory pressure?You might be misunderstanding the purpose of the -t option for 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. vnode A file specified with -f file becomes the backing store for this memory disk. swap Storage for this type of memory disk is allocated from buffer memory. Pages get pushed out to the swap when the system is under memory pressure, otherwise they stay in the operating memory. Using swap backing is gener- ally preferable over malloc backing. -t vnode points to a file, not to memory. I have no idea how that file is being backed though on the machine..> The idea is to load this backing storage once and only once > from the DVD into memory and leave it there.I think you wanted -t malloc -o reserve, maybe based on your description above. HTH, -Garrett
On Thu, May 27, 2010 at 04:48:42PM -0700, Dave Hayes wrote:> On FreeBSD 7.3-STABLE I'm mounting a DVD and doing something like > this: > > mdconfig -a -t vnode -o reserve -o readonly -f /dvd/file > > so that /dvd/file becomes the backing storage for my memory > disk.It sounds like what you really want is to load the contents of the specified file as a memory system? That's not part of mdconfig's repertoire, to the best of my recollection. If that's what you want, you need to use a different tool; the purpose of mdconfig is to provide scratch disk. The backing store is to specify a region its contents can be swapped out to if the system is under memory pressure (which certainly won't work with a DVD) -- Clifton -- Clifton Royston -- cliftonr@iandicomputing.com / cliftonr@lava.net President - I and I Computing * http://www.iandicomputing.com/ Custom programming, network design, systems and network consulting services