DEMAND PAGING EXAMPLE o Memory access time 200 nanoseconds o Average page-fault service time =8 milliseconds oEAT=(1-p)x 200+p (8 milliseconds) =(1-px200+px8,000,000 =200+px7,999,800 o If one access out of 1,000 causes a page fault,then EAT =8.2 microseconds. This is a slowdown by a factor of 40!!
DEMAND PAGING EXAMPLE Memory access time = 200 nanoseconds Average page-fault service time = 8 milliseconds EAT = (1 – p) x 200 + p (8 milliseconds) = (1 – p x 200 + p x 8,000,000 = 200 + p x 7,999,800 If one access out of 1,000 causes a page fault, then EAT = 8.2 microseconds. This is a slowdown by a factor of 40!!
PROCESS CREATION o Virtual memory allows other benefits during process creation: Copy-on-Write Memory-Mapped Files (later)
PROCESS CREATION Virtual memory allows other benefits during process creation: - Copy-on-Write - Memory-Mapped Files (later)
COPY-ON-WRITE o Copy-on-Write (COW)allows both parent and child processes to initially share the same pages in memory If either process modifies a shared page,only then is the page copied o COW allows more efficient process creation as only modified pages are copied o Free pages are allocated from a pool of zeroed- out pages
COPY-ON-WRITE Copy-on-Write (COW) allows both parent and child processes to initially share the same pages in memory If either process modifies a shared page, only then is the page copied COW allows more efficient process creation as only modified pages are copied Free pages are allocated from a pool of zeroedout pages
BEFORE PROCESS 1 MODIFIES PAGE C physical process memory process2 page A page B page C
BEFORE PROCESS 1 MODIFIES PAGE C
AFTER PROCESS 1 MODIFIES PAGE C physical process, memory process, pageA page B page C Copy of page C
AFTER PROCESS 1 MODIFIES PAGE C