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

1 Introducing HP-UX Memory File System (MemFS) 2.0
This chapter introduces you to the HP-UX implementation of Memory File System
(MemFS).
The following topics are discussed:
Overview
Need for a Memory-Based File System
Architecture of HP-UX Memory File System
Application Areas for HP-UX Memory File System
Dependencies
1.1 Overview
A Memory-based File System (MemFS) is a file system that resides in memory. It does
not normally write data out to stable storage. A MemFS is created from a mount
operation, and ceases to exist when it is un-mounted. The purpose of such a file system
is to provide fast access for temporary files that do not need to be kept for an
indeterminate time. Because it does not normally have to do I/O to stable storage, the
MemFS is able to provide extremely high throughput.
Keeping data in memory comes at a cost. It consumes system physical memory. Even
with today's large-memory systems, physical memory comes at a premium. A system
or application that runs out of available memory at a critical time can cause irreparable
loss to the user. This is the reason why most Virtual Memory (VM) management systems
implement a paging policy, wherein less frequently used memory pages are paged out
to a swap device. This policy has been extended to MemFS. Under memory pressure,
the VM system can deallocate MemFS pages and re-assign them where needed.
Unlike the MemFS on HP-UX 11iv2, the 11iv3 version of MemFS does not require a
user process to be associated with each of its instances. MemFS pages will be directly
written to system swap device under memory pressure and will be retrieved when
needed.
1.2 Need for a Memory-Based File System
A memory-based file system is typically used as storage for temporary files. By keeping
as much data as possible in memory, it avoids having to perform disk I/O and the
associated overhead. Traditional file systems manage two types of data. One is the file
content (called data), which an application accesses through the read, write and mmap
mechanisms. The other, called metadata is the information related to file attributes and
the file system structure.
Most file systems implement a buffering mechanism for data. This implies that a copy
of the disk data blocks is maintained in memory (buffer cache or page cache, based on
the implementation). This buffer is used to service the reads from a disk, and to
1.1 Overview 9