HP-UX Memory File System (MemFS) 2.0
Introducing HP-UX Memory File System (MemFS)
Architecture of HP-UX Memory File System
Chapter 110
Internally a MemFS behaves differently from other file systems. The syncer (1M)
1
daemon,
which periodically flushes "dirty" file system pages to disk, does not have an effect on MemFS
buffers, as MemFS buffers are never added to the syncer dirty list - which is processed
periodically for flushing. Periodically the VM paging algorithm reallocates the less used pages
from the buffer cache and user address spaces. MemFS data pages, too, can be recycled, and
written to the user memory allocated in the user address space of a process associated with
each mount instance. When accessed, the data is retrieved and copied to the buffer cache.
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 User Process Backing Store
MemFS requires a user process to be created for every MemFS mount instance. The address
space of the user process is used to store less frequently used MemFS data pages that have
been moved out of the buffer cache. The user process continues to exist as a daemon, sleeping
in the kernel, as long as the MemFS instance is mounted.
The decision to use a user process as the backing store was driven by the fact that the HP-UX
11i v2 kernel does not have support for pageable kernel memory.
Currently the HP-UX 11i v2 file systems use the buffer cache approach for managing the data
buffers. HP-UX 11i v3 has a unified file cache (UFC) model.
MemFS stores all data and metadata in the buffer cache. MemFS buffers are treated
differently from other buffers in that they are not normally chosen for replacement through
LRU policies. Since MemFS file data is stored in the buffer cache, rather than cached like
other file systems, performance is improved. However, when the number of MemFS buffer
pages exceeds the number computed by the tunable memfs_bufcache_swappct, data from
least recently used MemFS pages will be copied to the user address space of the associated
user process. These MemFS buffers are then released back to the buffer cache pool. Pages in
the user pageable memory can be chosen by the paging daemon to be paged out to the system
swap device and brought back to the buffer cache when they are accessed.
A pseudo driver called memfsswap acts as a pseudo disk and maintains a dynamic mapping of
MemFS memory pages and their virtual disk location on the user process.
1. The terms used here refer to those used with the HP-UX. Other implementations
may use a different terminology.