Memory File System (MemFS) 2.0 for HP-UX 11i v3

new layout, which stores file data in the UFC (Unified File Cache) and metadata in the
kernel memory. It does not use the user process address space as backing store for the
files data, during memory pressure. It has all the features needed for a basic file system.
Some of the more advanced file system features (e.g. journaling, un-buffered I/O) that
some of the contemporary file systems provide are neither required nor relevant in the
context of a memory file system.
A MemFS is created from a mount (1M) command. The mount operation just creates
the necessary data structures which are part of the new layout. It neither pre-allocates
the inodes or any memory as the backing store for the file data. The following data
structures are created as part of the mount operation:
Directory entry hash table
Inode hash table
The root directory of the mount instance
VFS Structure
Subsequent to a mount, the MemFS can be used just like any other file system, with
the same commands and system calls, as used on other file systems. From an application
or user perspective there should be nothing that differentiates it from any other file
system, except a better response time.
Internally, MemFS behaves differently from other file systems. Its directory entries are
organized in the Directory entry hash table, for faster lookup. The syncer (1M)1 daemon,
which periodically flushes "dirty" file system pages to disk, does not have an effect on
MemFS pages, as MemFS pages are never added to the syncer dirty list - which is
processed periodically for flushing. The metadata of each MemFS instance is allocated
from the kernel memory which can not be swapped. MemFS files data is store in UFC.
The MemFS pages in UFC are not treated specially from the pages of other file systems.
Periodically, the VM paging algorithm reallocates the less used pages including the
MemFS pages from the UFC. When VM paging algorithm decides to reallocate MemFS
pages during memory pressure, the MemFS files data will be written directly to system
swap device. When ever the files data is needed, the data will be brought back to UFC
directly from the system swap. Though HP-UX 11iv3 does not support pageable kernel
memory, MemFS and UFC interact with each other to accomplish the above tasks. Thus
the HP-UX 11iv3 MemFS does not require the instance specific user process address
space for swapping the files data. The overview of MemFS architecture is depicted in
the figure shown below (see figure1).
A umount (1M) on the MemFS removes the file system and all its data. As per the
specifications, data cannot be recovered once a umount (1M) happens.
MemFS uses two main resources: kernel memory and system swap space. These
resources are shared among all the kernel subsystems and user applications. Thus there
1.3 Architecture of HP-UX Memory File System 11