MemFS 2.0 - A Memory-based File System on HP-UX 11iv3

3
All the inodes are pre-allocated during the creation of file system, which wastes kernel
memory.
The maximum file system size and file size of MemFS is restricted to 256GB due to the
design of inodes in HFS and cannot grow up to the size of available system memory.
It does not scale well for large directories, as the directory entries are stored and
searched sequentially by HFS, which in turn degrades the performance of operations like
create, search on large directories.
Overheads during allocation of blocks for files and directory
Pre-allocates virtual memory of file system size (similar to RAM disk) during creation of file
system, which can cause the system to run out of virtual memory.
A new light weight layout is introduced in MemFS on HP-UX 11iv3 to overcome the above
problems, by storing metadata and data in better way to track them faster. The MemFS is entirely
implemented in the kernel, without requiring a separate user process. Metadata are stored in the
non-page able kernel dynamic memory and file data are kept in the Unified File Cache (UFC).
UFC is enhanced to automatically swap the MemFS file data into system swap device under
system memory/UFC pressure. The layout just contains minimum necessary information to provide
basic functionality of a file system.
Design
The memory file-based system which is available as a configurable product in HP-UX 11iv3 is
designed based on the various caches used by the operating system. Figure 1 is an illustration of
how MemFS is implemented on HP-UX 11iv3.
Figure 1. MemFS Design
The metadata needed are carved from the kernel memory (base cell memory). The data in the files
on memory file systems are cached in UFC (Unified file cache) similar to other file systems. But the
data are written on to swap devices transparently by UFC during memory pressure.
VFS
Super
block
Root inode
Hash
table of
directory
entries
vnode
vnode
inode
Swap
device
Instance specific information
Directory entries pointing to the inode
List of directory entries in a directory
Hash
table of
Inodes