Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Denning
unpredictable to a robust, self- interfaces, database systems, page as the unit of storage and
regulating technology that opti- graphics display systems, human- transfer. Even with this simplifi-
mized throughput without user computer interfaces, individual cation, programmers spent well
intervention. Virtual memory application programs, search over half their time planning and
programming page transfers, then could sink the system: translating page table entries in a small high-
called overlays. In a move to addresses to locations; and replac- speed associative memory, later
enable programming productivity ing loaded pages. They quickly known as the address cache or the
found
to at least double, the Atlas sys- Table 1. aMilestones
workable solutionin Developmentto the translation lookaside buffer. The
tem builders therefore decided to translationofproblem Localityby Idea.
storing replacement problem was a much
automate the overlaying process. copies of the most recently used more difficult conundrum.
Their “one-level storage Because the disk access
system” (later called vir- 1959 Atlas operating system includes first virtual memory; a “learning time was about 10,000
tual memory) was part algorithm” replaces pages referenced farthest in the future [5]. times slower than the
of the second-generation 1961 IBM Stretch supercomputer uses spatial locality to prefetch instructions CPU instruction cycle,
and follow possible branches.
Atlas operating system each page fault added a
1965 Wilkes introduces slave memory, later known as CPU cache, to hold
in 1959 [5]. It simulated most recently used pages and significantly accelerate effective significant delay to a job’s
a large main memory CPU speed [9]. completion time. There-
within a small real one. 1966 Belady at IBM Research publishes comprehensive study of virtual fore, minimizing page
memory replacement algorithms, showing that those with usage bits
The heart of their inno- outperform those without [1]. faults was critical to system
vation was the novel 1966 Denning proposes working set idea: the pages that must be retained in performance. Since mini-
concept that addresses main memory are those referenced during a window of length T mum faults means maxi-
preceding the current time. In 1967 he postulates that working set
named values, not mem- memory management will prevent thrashing [2–4]. mum inter-fault intervals,
ory locations. The 1968 Denning shows analytically why thrashing precipitates suddenly with the ideal page to replace
any increase above a critical threshold of number of programs in
CPU’s addressing hard- memory. Belady and Denning use term locality for the program from main memory is the
ware translated CPU behavior property working sets measure [2–4]. one that will not be used
addresses into memory 1969 Sayre, Brawn, and Gustavson at IBM demonstrate that programs with again for the longest time.
good locality are easy to design and cause virtual memory systems to
locations via an updata- perform better than a manually designed paging schedule. To accomplish this, the
1970 Denning gathers all extant results for virtual memory into Computing
ble page table map. By Atlas system contained a
allowing more addresses Surveys paper “Virtual Memory” that was widely used in operating “learning algorithm” that
systems courses. This was first coherent scientific framework for
than locations, their designing and analyzing dynamic memories [3]. hypothesized a loop cycle
scheme enabled pro- 1970 Mattson, Gecsei, Slutz, and Traiger of IBM publish “stack algorithms,” for each page, measured
modeling a large class of popular replacement policies including LRU
and MIN; they offer surprisingly simple algorithms for calculating their
grammers to put all their each page’s period, and
instructions and data paging functions in virtual memory [7]. estimated which page was
into a single address 1972 Spirn and Denning conclude that phase transition behavior is the most not needed for the longest
accurate description of locality [8].
space. The file contain- time.
ing the address space was 1970–74 Abramson, Metcalfe, and Roberts report thrashing in Aloha and
Ethernet communication systems; load control protocols prevent it.
The learning algorithm
on the disk; the operat- was controversial. It per-
1976 Buzen, Courtois, Denning, Gelenbe, and others integrate memory
ing system copied pages management into queueing network models, demonstrating that formed well on programs
thrashing is caused by the paging disk transitioning into the bottleneck
on demand (at page with increasing load. System throughput is maximum when the average with well-defined loops
faults) from that file to working set space-time is minimum. and poorly on many other
main memory. When 1976 Madison and Batson demonstrate that locality is present in symbolic programs. The contro-
execution strings of programs, concluding that locality is part of human
main memory was full, cognitive processes transmitted to programs [6]. versy spawned numerous
the operating system 1976 Prieve and Fabry demonstrate VMIN, the optimal variable-space
experimental studies well
selected a main memory replacement policy; it has identical page fault sequence with working into the 1960s that
set but lower space-time accumulation at phase transitions.
page to be replaced at sought to determine what
1978 Denning and Slutz define generalized working sets; objects are local
the next page fault. when their memory retention cost is less than their recovery costs. replacement rules might
The GWS models the stack algorithms, space-time variations of
working sets, and all variable-space optimal replacement algorithms.
The Atlas system work best over the widest
designers had to resolve 1980 Denning gathers the results of over 200 virtual-memory researchers and
two performance prob- concludes that working set memory management with a single system-
wide window size is as close to optimal as can practically be realized [4].
Table 1. Milestones in
lems, either one of which development of locality idea.
called thrashing. Early 1990s Computer forensics starts to emerge as a field; it uses locality and DISCOVERY AND
signal processing to recover the most recently deleted files; and it
Thrashing seemed to uses multiple system and network caches to reconstruction actions PROPAGATION OF LOCALITY
have nothing to do with of users. IDEA (1966–1980)
the choice of replacement 1990–1998 Beginning with Archie, then Gopher, Lykos, Altavista, and finally In 1965, I entered my
Google, search engines compile caches that enable finding relevant
policy. It manifested as a documents from anywhere on the Internet very quickly. Ph.D. studies at MIT in
sudden collapse of 1993 Mosaic (later Netscape) browser uses a cache to store recently Project MAC, which was
throughput as the multi- accessed Web pages for quick retrieval by the browser.
programming level rose. 1998 Akamai and other companies provide local Web caches (“edge
servers”) to speed up Internet access and reduce traffic at sources.
Table 2. Milestones in adoption
A thrashing system spent of locality.
just undertaking the development speak of a process’s intrinsic set of pages referenced in the vir-
of Multics. I was fascinated by memory demand as its “working tual time interval of length T pre-
the problems of dynamically allo- set.” The idea was that paging ceding time t [2].
cating scarce CPU and memory would be acceptable if the system By spring 1967, I had an
resources among the many could guarantee that the working explanation for thrashing.
processes that would Thrashing was the col-
populate future time- lapse of system through-
sharing systems. put triggered by making
I set myself a goal to the multiprogramming
solve the thrashing prob- level too high. It was
lem and define an effi- counterintuitive because
cient way to manage we were used to systems
memory with variable that would saturate
partitions. Solutions to under heavy load, not
these problems would be shut down. I showed
worth millions of dollars that, when memory was
in recovered uptime of filled with working sets,
virtual memory operat- any further increment in
ing systems. Little did I the multiprogramming
know that I would have Figure 1. Locality-sequence level would simultane-
to devise and validate a behavior diagrammed by programmer ously push all loaded
theory of program behavior to during overlay planning. programs into a regime of work-
accomplish this. ing set insufficiency. Programs
I learned about the controver- set was loaded. I combed the whose working sets were not
sies over the viability of virtual experimental studies looking for loaded paged excessively and
memory and was baffled by the clues on how to measure a pro- could not use the CPU effi-
contradictory conclusions among gram’s working set. ciently. I proposed a feedback
the experimental studies. I In an “Aha!” moment during control mechanism that would
noticed all these studies examined the waning days of 1966, limit the multiprogramming level
individual programs assigned to a inspired by Belady’s observations, by refusing to activate any pro-
fixed memory partition managed I hit on the idea of defining a gram whose working set would
by a replacement algorithm. They process’s working set as the set of not fit within the free space of
did not measure the dynamic pages used during a fixed-length main memory. When memory was
partitions used in multipro- sampling window in the immedi- full, the operating system would
grammed virtual memory sys- ate past. A working set could be defer programs requesting activa-
tems. There was no notion of a measured by periodically reading tion into a holding queue. Thrash-
dynamic, intrinsic memory and resetting the use bits in a ing would be impossible with a
demand that would tell us which page table. The window had to working set policy.
pages of the program were essen- be in the virtual time of the The working set idea was based
tial and which were replaceable— process—time as measured by the on an implicit assumption that the
something simple like, “this number of memory references pages seen in the backward win-
process needs p pages at time t.” made—so that the measurement dow were highly likely to be used
Such a notion was incompatible would not be distorted by inter- again in the immediate future.
with the fixed-space policies ruptions. This led to the now- Was this assumption justified? In
everyone was studying. I began to familiar notation: W(t,T) is the discussions with Jack Dennis
• In modules that implement the process’s locality set are kept in a objects, interpreted relative to
information-hiding principle. local cache with fast access time. semantic webs in which they are
• In accounting and event logs The cache can be a very high- embedded, can provide numerous
that monitor activities within a speed chip attached to a proces- clues to what the user is doing
system. sor, a main memory buffer for and allow the system to adapt
• In the “most recently used” disk or network transfers, a direc- dynamically and avoid unwel-
object lists of applications. tory for recent Web pages, or a come responses.
• In Web browsers to hold recent server for recent Internet Early virtual memory systems
Web pages. searches. The performance accel- suffered from thrashing, a form of
• In search engines to find the eration of a cache generally justi- software autism. Virtual memories
most relevant responses to fies the modest investment in the harnessed locality to measure soft-
queries. cache storage. ware’s dynamic memory demand
• In spread spectrum video Two new uses of locality are and adapt the memory allocation
streaming that bypasses network worth special mention. First, the to avoid thrashing. Future soft-
congestion and reduces the burgeoning field of computer ware may harness locality to help
apparent distance to the video forensics owes much of its success it discern the user’s context and
server. to the ubiquity of caches. They avoid autistic behavior. c
• In edge servers to hold recent are literally everywhere in operat-
Web pages accessed by anyone ing systems and applications. By References
in an organization or geograph- recovering these caches, forensics 1. Belady, L.A. A study of replacement algo-
rithms for virtual storage computers. IBM Sys-
ical region. experts can reconstruct an amazing tems J. 5, 2 (1966), 78–101.
amount of evidence about a crimi- 2. Denning, P.J. The working set model for pro-
gram behavior. Commun. ACM 11, 5 (May
Table 2 lists milestones in the nal’s motives and intent. Criminals 1968), 323–333.
adoption of locality. The locality who erase data files are still not 3. Denning, P.J. Virtual memory. ACM Comput-
principle is today considered a safe because experts use signal-pro- ing Surveys 2, 3 (Sept. 1970), 153–189.
4. Denning, P.J. Working sets past and present.
fundamental principle for systems cessing methods to recover the IEEE Trans. on Software Engineering SE-6, 1
design. faint magnetic traces of the most (Jan. 1980), 64–84.
5. Kilburn, T., Edwards, D.B.G., Lanigan, M.J.,
recent files from the disk. Not even Sumner, F.H. One-level storage system. IRE
FUTURE USES OF LOCALITY PRINCIPLE a systems expert can find all the Transactions EC-11 (Apr. 1962), 223–235.
The locality principle flows from caches and erase them. 6. Madison, A.W., and Batson, A. Characteristics
of program localities. Commun. ACM 19, 5
human cognitive and coordina- Second, a growing number of (May 1976), 285–294.
tive behavior. The mind focuses software designers are realizing 7. Mattson, R.L., Gecsei, J., Slutz, D.R., and
on a small part of the sensory software can be made more Traiger, I.L. Evaluation techniques for storage
hierarchies. IBM Systems J. 9, 2 (1970),
field and can work most quickly robust and less brittle if it can be 78–117.
on the objects of its attention. aware of context. Some have 8. Spirn, J. Program Behavior: Models and Mea-
surements. Elsevier Computer Science (1977).
People gather the most useful characterized current software as 9. Wilkes, M.V. Slave memories and dynamic
objects close around them to “autistic,” meaning that it is storage allocation. IEEE Transactions on Com-
minimize the time and work of uncommunicative, unsocial, and puters EC-14 (Apr. 1965), 270–271.
using them. These behaviors are unforgiving. An era of “post-
transferred into the computa- autistic software” can arise by
Peter J. Denning (pjd@nps.edu) is
tional systems we design. exploiting the locality principle to the director of the Cebrowski Institute for
The locality principle will be infer context and intent by information and innovation and superiority at
useful wherever there is an advan- watching sequences of references the Naval Postgraduate School in Monterey,
tage in reducing the apparent dis- to objects—for example, files, CA, and is a past president of ACM.
tance from a process to the documents, folders, and hyper-
objects it accesses. Objects in the links. The reference sequences of © 2005 ACM 0001-0782/05/0700 $5.00