. navigate
Minimizing Paging    Page 21 left arrow
right arrow Page 23    Minimizing Paging
Minimizing Paging

LISP Pointers
Volume I, Number 1
April-May 1987

Minimizing Paging
page 22

Prev Article               Start of This Article                Next Article

Object Grouping. Most Lisp implementations provide facilities for grouping objects. On the 3600, this is done using areas. In addition to allowing objects to be grouped, areas allow finer control over the garbage collector and the paging system.

When planning how objects should be grouped, it is important to minimize the use of inter-area pointers at runtime. For example, it is often not a good idea to group objects together if they are never going to be referenced together. When areas are used for object grouping, remember that the goal is to keep memory references local during common operations. Careless use of areas often produces the opposite effect by guaranteeing that objects are scattered across areas.

A refinement of object grouping is object ordering. When objects are not garbage collected, their positions in virtual memory remain constant. Because objects are allocated sequentially in an area, the order in which objects are created will be the same order as they are stored in memory. By carefully creating permanent objects in a predetermined order, paging of expected object traversals can be minimized.

Controlling prefetch. Prefetch is a 3600 feature that can be used to reduce the I/O overhead of page faults in some cases. When a page is fetched from secondary memory in a page fault, a number of other pages can be fetched in the same I/O operation; this number is controlled on a per-area basis. Prefetching is most successful when used in areas where objects are ordered and expected traversals of objects begin on a given page and span a fixed number of pages beyond that page. It is also useful when hard statistical data indicates that a high percentage of memory references are to pages that follow another recent memory reference. In general, prefetching is not useful in areas where object ordering is indeterminate, such as areas that can be garbage collected. In those areas it will simply add to paging overhead because the pages read with prefetch will displace pages more likely to be referenced.

Explicit paging. The 3600 provides functions for controlling paging explicitly. An object or page range can be fetched into main memory or postpurged (moved to the head of the page replacement queue). Because the entire set of pages is requested at once, I/O operations that transfer pages are combined and optimized, thus requiring significantly less time than would be required by separate demand page faults. Additionally, postpurging improves performance by assisting the algorithm that chooses pages to be replaced on future page faults.

Pages can be made to exist permanently in main memory by wiring them. Although wiring is considered extreme, it is useful in some cases, such as for algorithms that repeatedly access a structure with long enough gaps between references that the structure would otherwise be paged out.

Care must be taken that the use of paging-control functions actually benefits program execution in all cases. For example, fetching a large array before an operation may benefit performance on a machine configured with large physical

Page Left left arrow         
right arrow Page Right
Vol. I, No. 1
Table of Contents

Home   Favorites   Computers   Map

IME logo Copyright © 2009, Mary S. Van Deusen