DOC PREVIEW
Berkeley COMPSCI 162 - Lecture 12 Introduction in Networking

This preview shows page 1-2-3-19-20-39-40-41 out of 41 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 41 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 41 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 41 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 41 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 41 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 41 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 41 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 41 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 41 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS162 Operating Systems and Systems Programming Lecture 12 Introduction in NetworkingGoals for TodayAllocation of Page Frames (Memory Pages)Fixed/Priority AllocationPage-Fault Frequency AllocationThrashingLocality In A Memory-Reference PatternWorking-Set ModelWhat about Compulsory Misses?Demand Paging SummaryAdministrivia5min BreakWhat do this two have in Common?The ARPANetARPANet Evolves into InternetSlide 16Slide 17Slide 18Network “Cloud”Regional Nets + BackboneBackbones + NAPs + ISPsCore Networks + Access NetworksComputers Inside the CoreNetworking: How Hard Can It Be?Why Networking Is ChallengingFundamental Challenge: Speed of LightSlide 27Slide 28Why Networking Is Challenging (con’t)Examples of Network ComponentsSlide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37Slide 38Why Crooks Matter for NetworkingSlide 40SummaryCS162Operating Systems andSystems ProgrammingLecture 12Introduction in NetworkingMarch 2, 2011Ion Stoicahttp://inst.eecs.berkeley.edu/~cs162Lec 11.23/2 Ion Stoica CS162 ©UCB Spring 2011Goals for Today•Finish Page Replacement•Working Set/Thrashing•Introduction to networkingNote: Some slides and/or pictures in the following areadapted from slides ©2005 Silberschatz, Galvin, and Gagne. Many slides generated from my lecture notes by Kubiatowicz, Vern Paxson, and Randy Katz.Lec 11.33/2 Ion Stoica CS162 ©UCB Spring 2011Allocation of Page Frames (Memory Pages)•How do we allocate memory among different processes?–Does every process get the same fraction of memory? Different fractions?–Should we completely swap some processes out of memory?•Each process needs minimum number of pages–Want to make sure that all processes that are loaded into memory can make forward progress–Example: IBM 370 – 6 pages to handle SS MOVE instruction:»instruction is 6 bytes, might span 2 pages»2 pages to handle from»2 pages to handle to•Possible Replacement Scopes:–Global replacement – process selects replacement frame from set of all frames; one process can take a frame from another–Local replacement – each process selects from only its own set of allocated framesLec 11.43/2 Ion Stoica CS162 ©UCB Spring 2011Fixed/Priority Allocation•Equal allocation (Fixed Scheme): –Every process gets same amount of memory–Example: 100 frames, 5 processesprocess gets 20 frames•Proportional allocation (Fixed Scheme)–Allocate according to the size of process–Computation proceeds as follows:si = size of process pi and S = si m = total number of framesai = allocation for pi = •Priority Allocation:–Possible behavior: If process pi generates a page fault, select for replacement a frame from a process with lower priority number•Other schemes?–Change adaptively during process lifetimemSsiLec 11.53/2 Ion Stoica CS162 ©UCB Spring 2011Page-Fault Frequency Allocation•Can we reduce Capacity misses by dynamically changing the number of pages/application?•Establish “acceptable” page-fault rate–If actual rate too low, process loses frame–If actual rate too high, process gains frame•Question: What if we just don’t have enough memory?Lec 11.63/2 Ion Stoica CS162 ©UCB Spring 2011Thrashing•If a process does not have “enough” pages, the page-fault rate is very high. This leads to:–low CPU utilization–operating system spends most of its time swapping to disk•Thrashing  a process is busy swapping pages in and out•Questions:–How do we detect Thrashing?–What is best response to Thrashing?Lec 11.73/2 Ion Stoica CS162 ©UCB Spring 2011•Program Memory Access Patterns have temporal and spatial locality–Group of Pages accessed along a given time slice called the “Working Set”–Working Set defines minimum number of pages needed for process to behave “well”•Not enough memory for Working SetThrashing–Better to swap out process?Locality In A Memory-Reference PatternLec 11.83/2 Ion Stoica CS162 ©UCB Spring 2011Working-Set Model  working-set window  fixed number of page references –Example: 10,000 instructions•WSi (working set of Process Pi) = total set of pages referenced in the most recent  (varies in time)–if  too small will not encompass entire locality–if  too large will encompass several localities–if  =   will encompass entire program•D = |WSi|  total demand frames •if D > m  Thrashing–Policy: if D > m, then suspend/swap out processes–This can improve overall system behavior by a lot!Lec 11.93/2 Ion Stoica CS162 ©UCB Spring 2011What about Compulsory Misses?•Recall that compulsory misses are misses that occur the first time that a page is seen–Pages that are touched for the first time–Pages that are touched after process is swapped out/swapped back in•Clustering:–On a page-fault, bring in multiple pages “around” the faulting page–Since efficiency of disk reads increases with sequential reads, makes sense to read several sequential pages•Working Set Tracking:–Track working set of application–When swapping process back in, swap in working setLec 11.103/2 Ion Stoica CS162 ©UCB Spring 2011Demand Paging Summary•Replacement policies–FIFO: Place pages on queue, replace page at end–MIN: Replace page that will be used farthest in future–LRU: Replace page used farthest in past •Clock Algorithm: Approximation to LRU–Arrange all pages in circular list–Sweep through them, marking as not “in use”–If page not “in use” for one pass, than can replace•Nth-chance clock algorithm: Another approx LRU–Give pages multiple passes of clock hand before replacing•Second-Chance List algorithm: Yet another approx LRU–Divide pages into two groups, one of which is truly LRU and managed on page faults.•Working Set:–Set of pages touched by a process recently•Thrashing: a process is busy swapping pages in and out–Process will thrash if working set doesn’t fit in memory–Need to swap out a processLec 11.113/2 Ion Stoica CS162 ©UCB Spring 2011Administrivia•Project 2 will be out today •Midterm next week:–Wednesday, March 9th –Closed book, one page of hand-written notes (both sides)•Midterm Topics: Everything up to this Wednesday, March 2ndLec 11.123/2 Ion Stoica CS162 ©UCB Spring 20115min BreakLec 11.133/2 Ion Stoica CS162 ©UCB Spring 2011What do this two have in Common?•First printing press•Key idea: splitting up text in individual components–E.g., lower, upper case letters•Bible: first mass


View Full Document

Berkeley COMPSCI 162 - Lecture 12 Introduction in Networking

Documents in this Course
Lecture 1

Lecture 1

12 pages

Nachos

Nachos

41 pages

Security

Security

39 pages

Load more
Download Lecture 12 Introduction in Networking
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 12 Introduction in Networking and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 12 Introduction in Networking 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?