📄 1.t
字号:
.\" Copyright (c) 1986 The Regents of the University of California..\" All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)1.t 5.1 (Berkeley) 4/16/91.\".NHMotivations for a New Virtual Memory System.PPThe virtual memory system distributed with Berkeley UNIX has servedits design goals admirably well over the ten years of its existence.However the relentless advance of technology has begun to render itobsolete.This section of the paper describes the current design,points out the current technological trends,and attempts to define the new design considerations that shouldbe taken into account in a new virtual memory design..SHImplementation of 4.3BSD virtual memory.PPAll Berkeley Software Distributions through 4.3BSDhave used the same virtual memory design.All processes, whether active or sleeping, have some amount ofvirtual address space associated with them.This virtual address spaceis the combination of the amount of address space with which they initiallystarted plus any stack or heap expansions that they have made.All requests for address space are allocated from available swap spaceat the time that they are first made;if there is insufficient swap space left to honor the allocation,the system call requesting the address space fails synchronously.Thus, the limit to available virtual memory is established by theamount of swap space allocated to the system..PPMemory pages are used in a sort of shell game to contain thecontents of recently accessed locations.As a process first references a locationa new page is allocated and filled either with initialized data orzeros (for new stack and break pages).As the supply of free pages begins to run out, dirty pages arepushed to the previously allocated swap space so that they can be reusedto contain newly faulted pages.If a previously accessed page that has been pushed to swap is onceagain used, a free page is reallocated and filled from the swap area[Babaoglu79], [Someren84]..SHDesign assumptions for 4.3BSD virtual memory.PPThe design criteria for the current virtual memory implementationwere made in 1979.At that time the cost of memory was about a thousand times greater perbyte than magnetic disks.Most machines were used as centralized time sharing machines.These machines had far more disk storage than they had memoryand given the cost tradeoff between memory and disk storage,wanted to make maximal use of the memory even at the cost ofwasting some of the disk space or generating extra disk I/O..PPThe primary motivation for virtual memory was to allow thesystem to run individual programs whose address space exceededthe memory capacity of the machine.Thus the virtual memory capability allowed programs to be run thatcould not have been run on a swap based system.Equally important in the large central timesharing environmentwas the ability to allow the sum of the memory requirements ofall active processes to exceed the amount of physical memory onthe machine.The expected mode of operation for which the system was tunedwas to have the sum of active virtual memory be one and a halfto two times the physical memory on the machine..PPAt the time that the virtual memory system was designed,most machines ran with little or no networking.All the file systems were contained on disks that weredirectly connected to the machine.Similarly all the disk space devoted to swap space was alsodirectly connected.Thus the speed and latency with which file systems could be accessedwere roughly equivalent to the speed and latency with which swapspace could be accessed.Given the high cost of memory there was little incentive to havethe kernel keep track of the contents of the swap area once a processexited since it could almost as easily and quickly be reread from thefile system..SHNew influences.PPIn the ten years since the current virtual memory system was designed,many technological advances have occurred.One effect of the technological revolution is that themicro-processor has become powerful enough to allow users to have theirown personal workstations.Thus the computing environment is moving away from a purely centralizedtime sharing model to an environment in which users have acomputer on their desk.This workstation is linked through a network to a centralizedpool of machines that provide filing, computing, and spooling services.The workstations tend to have a large quantity of memory, but little or no disk space.Because users do not want to be bothered with backing up their disks,and because of the difficulty of having a centralized administrationbacking up hundreds of small disks, these local disks are typically used only for temporary storage and as swap space.Long term storage is managed by the central file server..PPAnother major technical advance has been in all levels of storage capacity.In the last ten years we have experienced a factor of four decrease in thecost per byte of disk storage.In this same period of time the cost per byte of memory has droppedby a factor of a hundred!Thus the cost per byte of memory compared to the cost per byte of disk isapproaching a difference of only about a factor of ten.The effect of this change is that the way in which a machine is usedis beginning to change dramatically.As the amount of physical memory on machines increases and the number ofusers per machine decreases, the expectedmode of operation is changing from that of supporting more active virtual memory than physical memory to that of having a surplus of memory that canbe used for other purposes..PPBecause many machines will have more physical memory than they do swapspace (with diskless workstations as an extreme example!),it is no longer reasonable to limit the maximum virtual memoryto the amount of swap space as is done in the current design.Consequently, the new design will allow the maximum virtual memoryto be the sum of physical memory plus swap space.For machines with no swap space, the maximum virtual memory willbe governed by the amount of physical memory..PPAnother effect of the current technology is that the latency and overheadassociated with accessing the file system is considerably highersince the access must be be over the networkrather than to a locally-attached disk.One use of the surplus memory would be tomaintain a cache of recently used files;repeated uses of these files would require at most a verification fromthe file server that the data was up to date.Under the current design, file caching is done by the buffer pool,while the free memory is maintained in a separate pool.The new design should have only a single memory pool so that anyfree memory can be used to cache recently accessed files..PPAnother portion of the memory will be used to keep track of the contentsof the blocks on any locally-attached swap space analogouslyto the way that memory pages are handled.Thus inactive swap blocks can also be used to cache less-recently-usedfile data.Since the swap disk is locally attached, it can be much more quicklyaccessed than a remotely located file system.This design allows the user to simply allocate their entire local diskto swap space, thus allowing the system to decide what files shouldbe cached to maximize its usefulness.This design has two major benefits.It relieves the user of deciding what filesshould be kept in a small local file system.It also insures that all modified files are migrated back to thefile server in a timely fashion, thus eliminating the need to dumpthe local disk or push the files manually..NHUser Interface.PPThis section outlines our new virtual memory interface as it is
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -