vax virtual

Upload: anil-mathur

Post on 04-Apr-2018

231 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Vax Virtual

    1/24

    Virtual Memory Management in

    the VAX/VMS Operating System

    Henry Levy and Peter Lipman, DEC

    Presenter Abhijeet Mahule

  • 7/30/2019 Vax Virtual

    2/24

    Introduction

    VAX-11/780 and VAX-11/750 were DECs firstimplementation of the 32-bit architecture

    The Operating System on them was a

    VAX/VMS Built on the experience of the PDP-11 system

    Intended to provide a single environment for

    all VAXbased applications These applications included real-time, time

    shared or batch.

  • 7/30/2019 Vax Virtual

    3/24

    Motivation

    VAX/VMS had to operate on a family ofprocessors

    These processors had different performancecharacteristics

    The physical memory capacities ranged from250KB to more than 8M bytes

    Memory management system had to be capable

    of handling changing demands of timesharingsystem

    Also they had to allow the predictableperformance of batch/real-time systems

  • 7/30/2019 Vax Virtual

    4/24

    VAX-11 hardware

    Basic entity in the VAX-11 system is the process

    Each process has a byte-addressable 32-bit virtual

    address space

    This address space is divided into 512-byte pages

    The 32-bits of an address contain 21-bit virtual

    page number and a 9-bit byte offset within the

    page

    Page is the basic unit of mapping and protection

  • 7/30/2019 Vax Virtual

    5/24

    VAX-11 hardware

    The upper two bits of the virtual address divide theprocess address space into a number of functionalregions or spaces

    Bit 31 Bit 30 Region/Space

    0 0 Program region (P0)

    0 1 Control Region (P1)

    1 0 System Space

    1 1 Unused Bits 9 29 (21 bits) refer to the Virtual Page number

    Bits 0 8 (9 bits) refer to byte offset within the page

  • 7/30/2019 Vax Virtual

    6/24

    VAX-11 hardware System Space

    The high address half of the address space (bit

    31 = 1) is system space and is shared by all

    processes in the system

    Thus, a system space virtual address

    generated by any process will access the same

    physical memory location

    Only half of the system space is utilized in this

    architecture

  • 7/30/2019 Vax Virtual

    7/24

    VAX-11 hardware Process Space

    The low-address half of the address space (bit31 = 0) is known as process space and isunique to each process

    Process space is divided into two regions bybit 30 of the virtual address

    The low-address half, known as P0 is the

    program region The high-address half, known as P1 is the

    control region

  • 7/30/2019 Vax Virtual

    8/24

    VAX-11 hardware - Regions

    Each region System, Program and Control, is

    defined by a page table

    A VAX-11 page table is a contiguous array of

    32-bit page table entries

    Each page table entry or PTE contains:

    A valid bit (PTE ) indicates whether thepage table entry contains mapping info

  • 7/30/2019 Vax Virtual

    9/24

    Page Table Entry (PTE) fields contd

    A protection field (PTE ) that indicates

    what privilege is required to read or write the

    page

    A modify bit ( PTE ) that indicates

    whether write access has occurred to the page

    A field used by the Operating System (PTE

    )

    The physical page frame number (PTE )

    that locates the page in physical memory

  • 7/30/2019 Vax Virtual

    10/24

    VAX-11 registers

    Each page table is defined by two hardwareregisters: base address register and lengthregister

    The System space page table is located byreference to the system page table base register,which contains its physical address

    The P0 and P1 page tables for each process are

    located in system space section of the addressspace

    P0 and P1 page table base registers containvirtual addresses

  • 7/30/2019 Vax Virtual

    11/24

    Use of address space by VAX/VMS

    All the three address regions are used for

    specific purposes

    All executable code and data including some

    process-specific data structures and process

    page tables, are stored in system region

    First few pages of system space, called vector

    region, contain pointers to executive service

    routines

  • 7/30/2019 Vax Virtual

    12/24

    Use of address space by VAX/VMS

    VAX/VMS is a collection of procedures that

    exist in the address space of each process

    These procedures can be called explicitly or

    implicitly to perform services on behalf of a

    process.

    The operating system does not have a

    separate address context.

  • 7/30/2019 Vax Virtual

    13/24

    Use of address space by VAX/VMS

    The P0 (program) region contains the usersexecutable program

    The users program can dynamically grow intohigher-addressed sections of P0 space

    VAX/VMS uses the P1 (Control) region to storeprocess-specific data

    P1 is also used to store the program image forcommand interpreter

    The users stack is located in low address part ofP1 region

  • 7/30/2019 Vax Virtual

    14/24

    Memory management implementation

    The typical concerns in a paging system were:

    Effect of one or more heavily paging programs on

    other programs in the system

    High cost of program start up and restart time invirtual memory environments

    Increased disk workload caused by paging

    Processor time consumed by searching page lists

    To overcome these problems, VAX/VMS is divided

    into two basic components: pager and swapper

  • 7/30/2019 Vax Virtual

    15/24

    Memory management implementation

    Pager:

    It is an operating system procedure that executes asresult of page fault

    It executes within the context of the faulting process It is responsible for loading and removing process

    pages into and out of memory

    Swapper:

    It is a separate process responsible for loading andremoving entire process into and out of memory

  • 7/30/2019 Vax Virtual

    16/24

    Memory management implementation

    A limit is placed on the amount of physical

    memory a process may occupy

    The set of pages currently in memory for a

    process is called the processs resident set and isdescribed by a pager data structure

    When a new program is started, its resident set is

    initially empty As the program executes, the pager loads the

    page whenever a non-resident page is referenced

  • 7/30/2019 Vax Virtual

    17/24

    Memory management implementation

    When the resident-set limit is reached, thefaulting process must release a page for eachnewly faulted page added to its resident set.

    FIFO replacement algorithm is used to selectthe page to be removed

    When a page is removed from a processs

    resident set, it is placed on one of two pagelists: the free page list or the modified pagelist

  • 7/30/2019 Vax Virtual

    18/24

    Memory management implementation

    If the modify bit is zero in the page table entry,

    the page is added to the tail of the free list

    If the modify bit is one in the page table entry,

    the page is queued on the tail of the modified

    page list.

    If a process faults a page that is on either list,

    the page is returned to the processs resident

    set

  • 7/30/2019 Vax Virtual

    19/24

    Clustering of pages

    The page size chosen for VAX/VMS is 512 bytes

    which can increase I/O overload due to small size

    VAX/VMS reduces the paging overload by reading

    and writing several pages at a time, which isknown as clustering

    The cluster size is the maximum number of pages

    the pager will attempt to load at once. A user can specify a default cluster size when a

    program is linked

  • 7/30/2019 Vax Virtual

    20/24

    Write Optimizations

    VAX/VMS delays the modified-page writerequests and gains these optimizations:

    If the page on the modified page list is referenced, it isreturned to the process at minimum cost

    When a write request must be performed, manypages can be written at once

    Pages can be arranged on the paging file so thatclustering on read requests is possible

    Due to delayed writes, many page writes are avoidedbecause either the pages are faulted again or programterminates

  • 7/30/2019 Vax Virtual

    21/24

    Swapper

    Entire resident sets can be swapped betweenmemory and the backing store.

    This is handled by a process called swapper whichis executed whenever it is awakened by theoperating system

    Whenever a process is removed from thememory, its entire resident set is written to aswap file, along with some process specific

    operating system data. The swapper operation may be performed in

    several pieces

  • 7/30/2019 Vax Virtual

    22/24

    Swapper

    The swapper writes all resident-set pages to acontiguous section of the swap file

    When a process not in memory becomes able toexecute, it is read in by the swapper

    The swapper allocates pages for the resident set,page tables, and operating system datastructures.

    When a new process is created, the swapperswaps in a process shell, which provides theinitial environment in which a program can beexecuted

  • 7/30/2019 Vax Virtual

    23/24

    Conclusions

    VAX/VMS takes a slightly unorthodox approach tovirtual memory management

    Three major mechanisms have been used to enhancethe performance of the OS:-

    Caching of pages: reduces the number of disk I/Otransactions

    Clustering: provides transfer efficiency of large pagesalong with the fragmentation characteristics of smallpages

    Use of process-local replacement along with swapping:to reduce the effect of one processs paging activitieson anothers

  • 7/30/2019 Vax Virtual

    24/24

    Thank You!

    Questions?