VMCMD — User Commands
NAME
vmcmd − set virtual memory parameters.
SYNOPSIS
vmcmd [options]
OPTIONS
−a flagValueIf flagValue is non-zero then the virtual memory system is forced to always refuse any file system requests for memory.
−A flagValueIf flagValue is non-zero then the virtual memory system is forced to always satisfy any file system request for memory as long as it is possible.
−c pagesToCheckThe number of pages to check during each interation of the clock algorithm is set to pagesToCheck .
−C flagValueIf flagValue is non-zero then copy-on-write is enabled.
−f flagValueIf flagValue is non-zero then pages are freed as soon as they are cleaned.
−F penaltyIf penalty is less than zero then the file system is forced to pay a penalty of -penalty seconds when asking for a page. If it is greater than or equal to zero then the penalty is used in conjunction with the −n option.
−fsresetReset the recorded minimum and maximum size of the file system cache to the current size.
−x segNumSegment segNum is flushed from memory; the −h and −l options can be used to set upper and lower bounds respectively on the pages that are flushed.
−h pageNumThe highest page that can be flushed is pageNum when using −x option.
−l flagValueThe lowest page that can be flushed is pageNum when using −x option.
−n numGroupsThe number of groups to divide memory into when assessing a penalty is set to numGroups.
−p pageOutProcsThe number of processes used to write back pages is set to pageOutProcs.
−P flagValueIf flagValue is non-zero then pre-fetching is turned on.
−r flagValueIf flagValue is non-zero then pages that are copied because of copy-on-reference faults are made read-only until they get modified.
−R flagValueIf flagValue is non-zero then the virtual memory system will try to take advantage of the file system’s read ahead policy.
−s numSecondsThe number of seconds between iterations of the clock algorithm is set to be numSeconds.
−t tracesPerSecVirtual memory tracing is turned on at the rate of tracesPerSec traces per second.
−TVirtual memory tracing is turned off.
−e n [ -X n2 ]Hook for extra commands. This executes Vm_Cmd(n,n2), with n2 defaulting to 0.
INTRODUCTION
This command sets various parameters of the virtual memory system. It is implemented using the Vm_Cmd system call. It controls behavior of the virtual memory system in 7 areas: virtual memory and file system negotiation, virtual memory tracing, the speed of the clock algorithm, flushing of segments, prefetch, copy-on-write and other miscellaneous things.
VM-FS NEGOTIATION
There are four options to vmcmd that can be used to control the negotiation between the virtual memory system and the file system. The most interesting are the options which allow the file system to be penalized relative to the virtual memory system. The −F and −n options are used to control the penalty. The simplest way to penalize the file system is to supply the −F penalty option with a negative number. In this case the file system is penalized by the absolute value of penalty each time that it asks for memory. The penalty is assessed by adding penalty seconds to the access time of each VM page so that the VM pages seem to have been used more recently than they really have.
The −n numGroups option gives a more complex method of penalizing the file system. With this option the number of available pages are divided up into numGroups groups. When the file system asks for memory the penalty depends on how many pages that it already has. Its penalty is assessed as
(current-number-of-pages / numGroups) ∗ penalty
seconds.
There are two other ways to effect the VM-FS negotiation. The −a option can be used to force the virtual memory system to always refuse to give memory to the file system. The −A can be used to force the virtual memory sysytem to always satisfy the file system’s requests for memory as long as they are feasible. These options are designed to be used to determine the effect of different polices on VM and FS negotiation.
TRACING
The virtual memory system has the ability to trace segment creation and destruction, reference and modify bit use, page faults and copy-on-write behavior. Tracing is turned on with −t tracePerSec option. Once tracing is turned on everything but the reference and modify bit traces will be traced as it occurs. However, the reference and modify bits are traced by scanning the hardware page maps tracePerSec times per second. The output of the trace is stored in the file “/sprite/vmtrace/tfile.host-id” where host-id is the sprite id for the host. Tracing is terminated with the −T option.
CLOCK
The virtual memory system keeps all pages in approximate least-recently-used (LRU) order by using a version of the clock algorithm. The clock algorithm is implemented by scanning a given number of pages in memory every few seconds. The number of pages that are scanned can be set with the −c pagesToCheck option and how often the pages are scanned can be set with the −s numSeconds option. The result is that pagesToCheck pages are checked every numSeconds.
FLUSHING
In order to allow measurement of the performance of the virtual memory system, vmcmd allows segments to be flushed from memory. When a segment is flushed dirty pages are written to swap space and the pages in the segment are removed from memory. The −x segNum option is used to specify which segment to flush and the −l lowPageNum and −h highPageNum options are used to specify the range of pages to flush. By default the lowest page to flush is the lowest page in the segment and the highest is the highest page in the segment. However, the −l or −h options can be used to set the lowest page to lowPageNum and the highest to highPageNum respectively.
PREFETCH
Both the virtual memory system and the file system implement prefetch. Virtual memory prefetch can be turned on or off by using the −P flagValue option; if flagValue is non-zero then prefetching is enabled and if it is zero prefetching is disabled. Likewise whether or not the virtual memory system takes advantage of the file system’s prefetech can be determined with the −R flagValue option; non-zero means use FS prefetch, 0 means don’t use it.
COPY-ON-WRITE
Copy-on-write can be turned on or off by using the −C flagValue option. If flagValue is non-zero then copy-on-write is enabled and if it zero copy-on-write is disabled.
MISCELLANEOUS
There are two other parameters of the virtual memory system that can be set with vmcmd. The number of processes that are used to write out dirty pages can be set with the −p pageOutProcs option. Whether or not memory is freed once it gets to the front of the allocate list or it is left alone until it has to be recycled is controlled with the −f flagValue option; if flagValue is non-zero then pages are freed once they are cleaned and if it is zero pages remain on the front of the allocate list after they are cleaned.
KEYWORDS
virtual memory
Sprite version 1.0 — March 10, 1991