summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
830244d)
SCCS-vsn: share/doc/papers/memfs/0.t 1.4
SCCS-vsn: share/doc/papers/memfs/1.t 1.4
-.\" @(#)0.t 1.3 (Copyright 1990 M. K. McKusick) 90/04/16
+.\" @(#)0.t 1.4 (Copyright 1990 M. K. McKusick) 90/04/16
.rm CM
.nr PO 1.25i
.ds CH "
.rm CM
.nr PO 1.25i
.ds CH "
email: mckusick@cs.Berkeley.EDU
telephone: 415-642-4948
.AB
email: mckusick@cs.Berkeley.EDU
telephone: 415-642-4948
.AB
-This paper describes the motivation for a memory-based filesystem.
-It compares the techniques used to implement them and
+This paper describes the motivations for memory-based filesystems.
+It compares techniques used to implement them and
describes the drawbacks of using dedicated memory to
support such filesystems.
To avoid the drawbacks of using dedicated memory,
describes the drawbacks of using dedicated memory to
support such filesystems.
To avoid the drawbacks of using dedicated memory,
-it tells how to build a simple memory-based
+it discusses building a simple memory-based
filesystem in pageable memory.
It details the performance characteristics of this filesystem
and concludes with areas for future work.
filesystem in pageable memory.
It details the performance characteristics of this filesystem
and concludes with areas for future work.
-.\" @(#)1.t 1.3 (Copyright 1990 M. K. McKusick) 90/04/16
+.\" @(#)1.t 1.4 (Copyright 1990 M. K. McKusick) 90/04/16
a memory-based filesystem.
Memory-based filesystems have existed for a long time;
they have generally been marketed as RAM disks or sometimes
a memory-based filesystem.
Memory-based filesystems have existed for a long time;
they have generally been marketed as RAM disks or sometimes
-as software packages that use the general purpose memory on
-a machine.
+as software packages that use the machine's general purpose memory.
that do not have an effective way of using the extra memory anyway.
.PP
Most software RAM disks lose their contents when the system is powered
that do not have an effective way of using the extra memory anyway.
.PP
Most software RAM disks lose their contents when the system is powered
The contents can be saved by using battery backed-up memory,
The contents can be saved by using battery backed-up memory,
-by storing critical filesystem data structure in the filesystem,
+by storing critical filesystem data structures in the filesystem,
and by running a consistency check program after each reboot.
and by running a consistency check program after each reboot.
-These conditions increase the hardware cost,
+These conditions increase the hardware cost
and potentially slow down the speed of the disk.
Thus, RAM-disk filesystems are not typically
designed to survive power failures;
because of their volatility, their usefulness is limited to transient
and potentially slow down the speed of the disk.
Thus, RAM-disk filesystems are not typically
designed to survive power failures;
because of their volatility, their usefulness is limited to transient
-or easily recreated information such as would be found in
+or easily recreated information such as might be found in
.PN /tmp .
Their primary benefit is that they have higher throughput
than disk based filesystems.
.PN /tmp .
Their primary benefit is that they have higher throughput
than disk based filesystems.
smith
.]
This improved throughput is particularly useful for utilities that
smith
.]
This improved throughput is particularly useful for utilities that
-make heavy use of temporary files such as many compilers.
+make heavy use of temporary files, such as compilers.
On fast processors, nearly half of the elapsed time for a compilation
is spent waiting for synchronous operations required for file
creation and deletion.
On fast processors, nearly half of the elapsed time for a compilation
is spent waiting for synchronous operations required for file
creation and deletion.
by using the memory where it is getting the highest access rate.
These needs may shift between supporting process virtual address spaces
and caching frequently used disk blocks.
by using the memory where it is getting the highest access rate.
These needs may shift between supporting process virtual address spaces
and caching frequently used disk blocks.
-If the memory is to be dedicated to the filesystem,
+If the memory is dedicated to the filesystem,
it is better used in a buffer cache.
The buffer cache permits faster access to the data
because it requires only a single memory-to-memory copy
it is better used in a buffer cache.
The buffer cache permits faster access to the data
because it requires only a single memory-to-memory copy
to the buffer cache,
then another copy from the buffer cache to the user process.
.PP
to the buffer cache,
then another copy from the buffer cache to the user process.
.PP
-The new work being presented in this paper is to build
-a prototype RAM-disk filesystem in pageable memory instead of dedicated memory.
+The new work being presented in this paper is building a prototype
+RAM-disk filesystem in pageable memory instead of dedicated memory.
The goal is to provide the speed benefits of a RAM disk
without paying the performance penalty inherent in dedicating
part of the physical memory on the machine to the RAM disk.
The goal is to provide the speed benefits of a RAM disk
without paying the performance penalty inherent in dedicating
part of the physical memory on the machine to the RAM disk.
This configuration allows small files to be accessed quickly,
while still allowing
.PN /tmp
This configuration allows small files to be accessed quickly,
while still allowing
.PN /tmp
-to be used for big files, albeit
-at the speed more typical of normal disk-based filesystems.
+to be used for big files,
+although at a speed more typical of normal, disk-based filesystems.
.PP
An alternative to building a memory-based filesystem would be to have
a filesystem that never did operations synchronously and never
flushed its dirty buffers to disk.
However, we believe that such a filesystem would either
use a disproportionately large percentage of the buffer
.PP
An alternative to building a memory-based filesystem would be to have
a filesystem that never did operations synchronously and never
flushed its dirty buffers to disk.
However, we believe that such a filesystem would either
use a disproportionately large percentage of the buffer
-cache space, to the detriment of other disk based filesystems,
-or would require the paging system to push out its dirty pages.
+cache space, to the detriment of other filesystems,
+or would require the paging system to flush its dirty pages.
Waiting for other filesystems to push dirty pages
subjects them to delays while waiting for the pages to be written.
We await the results of others trying this approach.
Waiting for other filesystems to push dirty pages
subjects them to delays while waiting for the pages to be written.
We await the results of others trying this approach.
specifies the block device containing the filesystem.)
.PP
The mount system call allocates and initializes a mount table
specifies the block device containing the filesystem.)
.PP
The mount system call allocates and initializes a mount table
-entry, then calls the filesystem-specific mount routine.
+entry and then calls the filesystem-specific mount routine.
The filesystem-specific routine is responsible for doing
the mount and initializing the filesystem-specific
portion of the mount table entry.
The filesystem-specific routine is responsible for doing
the mount and initializing the filesystem-specific
portion of the mount table entry.
must do the I/O itself to avoid deadlock.
.PP
The final piece of kernel code to support the
must do the I/O itself to avoid deadlock.
.PP
The final piece of kernel code to support the
-memory-based filesystem is in the close routine.
-After a filesystem is successfully unmounted,
+memory-based filesystem is the close routine.
+After the filesystem has been successfully unmounted,
the device close routine is called.
For a memory-based filesystem, the device close routine is
.RN mfs_close .
the device close routine is called.
For a memory-based filesystem, the device close routine is
.RN mfs_close .
as an indication that the filesystem is unmounted.
The
.RN mfs_mount
as an indication that the filesystem is unmounted.
The
.RN mfs_mount
-routine exits which in turn causes the \fInewfs\fP process
-to exit, resulting in the vanishing of the filesystem in a cloud of dirty pages.
+routine exits, in turn causing the \fInewfs\fP process
+to exit, resulting in the filesystem vanishing in a cloud of dirty pages.
.PP
The paging of the filesystem does not require any additional
code beyond that already in the kernel to support virtual memory.
The \fInewfs\fP process competes with other processes on an equal basis
.PP
The paging of the filesystem does not require any additional
code beyond that already in the kernel to support virtual memory.
The \fInewfs\fP process competes with other processes on an equal basis
-for the available memory on the machine.
+for the machine's available memory.
Data pages of the filesystem that have not yet been used
are zero-fill-on-demand pages that do not occupy memory,
although they currently allocate space in backing store.
Data pages of the filesystem that have not yet been used
are zero-fill-on-demand pages that do not occupy memory,
although they currently allocate space in backing store.
-If memory is plentiful, the entire contents of the filesystem
+As long as memory is plentiful, the entire contents of the filesystem
-When memory runs short, the oldest pages of \fInewfs\fP are
-pushed to backing store.
+When memory runs short, the oldest pages of \fInewfs\fP will be
+pushed to backing store as part of the normal paging activity.
The pages that are pushed usually hold the contents of
files that have been created in the memory-based filesystem
but have not been recently accessed (or have been deleted).
The pages that are pushed usually hold the contents of
files that have been created in the memory-based filesystem
but have not been recently accessed (or have been deleted).
In that system, the implementation of a memory-based filesystem
that avoids the double copy and context switches will be much easier.
.PP
In that system, the implementation of a memory-based filesystem
that avoids the double copy and context switches will be much easier.
.PP
-Ideally part of the kernel's address space could reside in pageable memory.
+Ideally part of the kernel's address space would reside in pageable memory.
Once such a facility is available it would be most efficient to
build a memory-based filesystem within the kernel.
One potential problem with such a scheme is that many kernels
Once such a facility is available it would be most efficient to
build a memory-based filesystem within the kernel.
One potential problem with such a scheme is that many kernels