Hi there, I haven't yet had any cause to use memory filesystems in FreeBSD, but I was just reading about them the other day and I came across references to malloc-backed and swap-backed. I have read the man page for vnconfig and mfs on -STABLE, and for mdconfig on -CURRENT, but I'm still a little confused and would appreciate some clarifications. So I have a few questions which I will try to keep relevant to -STABLE, although if the situation has significantly changed in -CURRENT then a commnent about that would be appreciated too.. So you can make a swap-backed filesystem in -STABLE with vnconfig -S, but why would you ever want to do this? Why is this preferred over just using a regular file? Then there is malloc-backed filesystem as created with mfs in STABLE. Presumably this works with virtual memory and lazy allocation the same way as malloc() from a program would do, i.e. it is possible to create an FS that is bigger than the amount of physical memory in the system, and whenever files are stored in the FS it is similar to any other request to the VM system, may be satisfied with real memory or go into swap? I understand that in -CURRENT, mdconfig replaces vnconfig for managing MFS that are either malloc-backed, swap-backed or file-backed, right? -- Encrypted mail welcome - keyid 0xBF15490B> > > The optimum programming team size is 1.Has Jurassic Park taught us nothing? -- pfilandr@mindspring.com, news:comp.lang.c -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20040417/a68cae9c/attachment.bin
> So you can make a swap-backed filesystem in -STABLE with vnconfig > -S, but why would you ever want to do this?I use mdconfig to check if iso file is made corectly. mdconfig -a -t vnode -f my.iso mount -t cd9660 /dev/md* /mnt ----------------------------- umount /mnt mdconfig -d -u * (* is probably 0.) Someone else will give you up to million reasons to use it. ZK
Andy Smith <andy@strugglers.net> wrote: > So you can make a swap-backed filesystem in -STABLE with vnconfig > -S, but why would you ever want to do this? Why is this preferred > over just using a regular file? Upon unmount of the FS, the regular file will stay there, so you have to remove it yourself. A swap-backed FS will disappear completely upon unmount. But more importantly, a swap-backed FS is more efficient, because you don't have all the overhead of the filesystem which contains the regular file. > Then there is malloc-backed filesystem as created with mfs in > STABLE. Presumably this works with virtual memory and lazy > allocation the same way as malloc() from a program would do, i.e. > it is possible to create an FS that is bigger than the amount of > physical memory in the system, and whenever files are stored in the > FS it is similar to any other request to the VM system, may be > satisfied with real memory or go into swap? Yes, that's correct. Basically, the file system data is contained in the process image of the mount_mfs process. You can see it in "ps" and "top": top: 32 root 10 0 101M 76416K mfsidl 0:29 0.00% 0.00% mount_mfs df -k: mfs:32 100750 254 100496 0% /tmp Regards Oliver -- Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 M?nchen Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "That's what I love about GUIs: They make simple tasks easier, and complex tasks impossible." -- John William Chambless