全部博文(116)
分类: 嵌入式
2014-02-06 10:47:17
----------------
One downside of ramfs is you can keep writing data into it until you fill up all memory, and the VM can't free it because the VM thinks that files should get written to backing store (rather than swap space), but ramfs hasn't got any backing store. Because of this, only root (or a trusted user) should be allowed write access to a ramfs mount.
ramfs的一个不足之处是:如果不断地向ramfs写入数据,将会耗尽所有的内存,并且VM不能释放它。
由于VM(Vitual Memory)认为文件应该被写回后备存储器,而不是交换空间(swap space),另一方面ramfs并不能获得任何的后备存储,所以VM不能释放ramfs分配的内存。从而,只有root用户(or trusted user)才能进行ramfs写操作。
A ramfs derivative called tmpfs was created to add size limits, and the ability to write the data to swap space. Normal users can be allowed write access to tmpfs mounts.
tmpfs是ramfs的衍生物,用来限制缓存大小、具备向swap空间写入数据的能力。允许普通用户对挂载在tmpfs上的文件系统执行写操作。
tmpfs是用来保存VM所有文件的文件系统。tmpfs中缓存的内容全部是临时的。一旦卸载,所有的内容都会遗失。它把所有的缓存置于内核,它的规模随着文件的规模同步变化。但是它规模有大小限制,可以修改。它可以把当前不再需要的页写入到swap空间。
See Documentation/filesystems/tmpfs.txt for more information.