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:
>
> =A0mdconfig -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 unde=
r
> 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 wit=
h
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 memor=
y
disk is a very easy way to panic a system.
vnode A file specified with -f file becomes the backing sto=
re
for this memory disk.
swap Storage for this type of memory disk is allocated fro=
m
buffer memory. Pages get pushed out to the swap when
the system is under memory pressure, otherwise they s=
tay
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 ab=
ove.
HTH,
-Garrett
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"