






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Palsetia; Class: DIG SYSTEM ORG & DESIGN; Subject: Computer & Information Technology; University: University of Pennsylvania; Term: Spring 2007;
Typology: Study notes
1 / 10
This page cannot be seen from the preview
Don't miss anything!







12 - 2
CIT 595
process
is an instance of a computer program that is
being executed• Monoprogramming
¾^ One process in memory at a time runs till completion ¾^ With OS as supervisor
¾^ Process Address space is 0 to 2
n- where n = machine size
¾^ Main memory is temporary storage not made as big as processaddress space ¾^ Instead your program is usually stored on some form ofpermanent storage (disk or tape) Why not just make main memory large enough?
12 - 3
CIT 595
¾^ e.g. 32-bit address (with 1 byte storage ): ~4 GB
¾^ 80 GB of DRAM: ~ $21,000 vs. 80 GB of disk: ~ $
1GB: ~$
80 GB: ~$
4 MB: ~$
Disk
DRAM
SRAM
12 - 4
CIT 595
¾^ Family line of computers is a suite of compatible designs forsame command set or ISA ¾^ Allowed customers to purchase a smaller system with theknowledge they could upgrade to larger system
¾^ Earlier programmers had to do explicit memory management
¾^ Hence the
concept of Virtual Memory
i.e. memory appears to be
but isn't
12 - 5
n^ -
where n is machine width
m^ -
where m < n
Program's Logical
View(VM)
CodeHeap Stack
Physical/Main Memory
Note: Logicaladdress orderneed not bemaintained inphysical memory
12 - 6
CIT 595
¾^ Mapping need not preserve continuity of data in both physicalmemory and disk ¾^ Logical address is only from program's point of view
Disk
MainMemory
12 - 7
¾E.g. Word processor and paint application are beingsimultaneously used by the user
¾the program is the same i.e. the instructions
but
the data is
different ¾the program counters are different
active
part of the code and data of process is in
main memory^ ¾
Allocate more memory to process as needed
12 - 8
CIT 595
z^ This known as time-sharing the processor z^ O.S decides which processes gets the CPU based on ascheduling algorithm (more on this in chp 8)
Program 1
Program 2
MainMemory
12 - 13
Information concerning the location of each page, ismaintained in a data structure called a
page table
¾^ Operating System (OS) maintains this data structure ¾^ The page table is placed in memory at a known location ¾^ The Virtual Page number is used as an offset into the table tofind which frame in Physical Memory is the data located
Note: Page Tableentries are equalto number ofpages to minimizesearch time
12 - 14
CIT 595
8 and a physical
address space of 2
words
¾^ A virtual address has 8 bits ¾^ Of the 8 bits, 5 bits are used for offset (
5 = 32 words)
¾^ Remaining 3 bits are used for Virtual Page Number (VPN) ¾^ Since physical memory address is 7 bits, 5 bits go to offset(offset part is never modified) and hence 2 bits are used forPage Frame Number(PFN)
14
5
5
12 - 15
Virtual Address 13 is produced by the processor for aprocess, what is the Physical Address?
Physical Address = 1001101 (
12 - 16
CIT 595
own
page table
-^ OS responsible
for
updating
page tables so that virtual
address spaces of different processes do not collide
Program's Logical View CodeHeap Stack
12 - 17
state
of
the existing process is saved before the new process isallowed to use the CPU
¾In addition to the program counter and registers, thepage table is also saved
¾When a new process gets the CPU, the OS loads thestate of the process ¾Like PC register is used to load the PC, the page tableaddress is loaded into an internal register called
Page
Table Pointer
12 - 18
CIT 595
12 - 19
Use a valid bit like we used in cache ¾^
Valid bit = 1, means page is in physical memory
12 - 20
CIT 595
¾This is known as an occurrence of
page fault
¾Job of the exception routine is to find the pagerequired from disk and put it in main memory ¾OS also maintains a data structure to record whereeach virtual page is stored on disk ¾This data structure can be part of the page table orbe a separate structure all together
12 - 25
Frame #
12 - 26
CIT 595
Modern Processor with Cache and Virtual Memory • Studied Cache and Physical memory interaction• Found Caches indexed using physical/main memoryaddress• But processor (CPU) generates a logical/virtualaddress• So then how does the whole memory system work?• Require Address Translation before Cache Lookup^ ¾
Problem: Involve a memory access itself (page tablelookup) ¾Solution: We know that page table entries can also becached. Hence use TLB to translate VA to PA and thenuse cache.
12 - 27
CPU ¾Allows multiple processes to have blocks in cacheat same time ¾Access time for data is faster as we doing twoSRAM (TLB and Cache) lookups which is still fasterthan two DRAM (main memory)
Translationby TLB
Cache
MainMemory
VA
PA
miss
hit
data
12 - 28
CIT 595
All Memory put together: Cache, TLB and Paging VM
12 - 29
¾H is the hit rate i.e. % time data is found in level
i
12 - 30
CIT 595
12 - 31
EAT = 0.99(200ns + 200ns) 0.01(10ms) = 100, 396ns
12 - 32
CIT 595
12 - 37
12 - 38
CIT 595
12 - 39
-^ Enhances performance by providing greater memorycapacity, without the expense of adding main memory•^ The programmer does not have to worry about addressspace i.e. illusion
of very large memory
¾^ The movement of data is transparent i.e. data between the twolevels are exchanged by O.S. without the knowledge of theuser
¾^ Has private address space ¾^ Unaffected by behaviour of other processes