Docsity

TCSS 422: Operating Systems - Beyond Physical Memory, Review for Final Exam, Slides of Operating Systems

Toggle sidebar
bg1
TCSS 422 A –Fall 2021
School of Engineering and Technology
12/9/2021
L18.1
Slides by Wes J. Lloyd
December 9, 2021 TCSS422: Operating Systems [Fall 2021]
School of Engineering and Technology, University of Washington - Tacoma
Beyond Physical M emory,
Review fo r Fi nal Ex am
Wes J. Lloyd
Sc hool o f En gi ne er in g and Technology
Un iversity of Washingto n - Tac om a
TCSS 422: OPERATING SYSTEMS
In de pe nd ent study i n “c lo ud c om pu ti ng”
Work to co ll abora tivel y dra ft a pr oposal
an d su bm it t o Dr. Nascim ento, C SS Ch ai r for approv al
Fo cus on v ariety of top ics re la ted to c loud/di str ib uted sys tems
Var iab le c red its from 1 to 5
In volve s p art ic ip atio n in wee kl y re se arch gro up me et in g
▪Win ter 20 22: Wednes day at 12:30p
Us ua ll y 1 o r 2 on e- on-o ne o r s ma ll g ro up m ee ti ng d uring wee k
Co nt act by em ail if i nterest ed
Id en ti fy p referred qu art er (s)
Nu mb er o f cre di ts
Ca n take up to 10 c redits TCSS 4 98 /499 - CS S ele ctive cr edi ts
2022 - TCSS 498/499 (ANY QUARTER)
UNDERGRADUATE READING/RESEARCH IN CSS
December 9, 2021 TCSS422: Operating Systems [Fall 2021]
School of Engineering and Technology, University of Washington - Tacoma L18.2
1
2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download TCSS 422: Operating Systems - Beyond Physical Memory, Review for Final Exam and more Slides Operating Systems in PDF only on Docsity!

School of Engineering and Technology December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma

Beyond Physical Memory,

Review for Final Exam

Wes J. Lloyd

School of Engineering and Technology

University of Washington - Tacoma

TCSS 422: OPERATING SYSTEMS  Independent study in “cloud computing”  Work to collaboratively draft a proposal and submit to Dr. Nascimento, CSS Chair for approval  Focus on variety of topics related to cloud/distributed systems  Variable credits from 1 to 5  Involves participation in weekly research group meeting ▪ Winter 2022: Wednesday at 12:30p  Usually 1 or 2 one-on-one or small group meeting during week  Contact by email if interested  Identify preferred quarter(s)  Number of credits  Can take up to 10 credits TCSS 498/499 - CSS elective credits 2022 - TCSS 498/499 (ANY QUARTER) UNDERGRADUATE READING/RESEARCH IN CSS December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 2

School of Engineering and Technology  Please complete the cour se evaluatio n sur vey at:  TCSS 422 A - Computer Operating Systems:  https://uwt.iasystem.org/sur vey/  S pecial features this quar ter in TCS S 4 2 2 :  Class sessions LIVE streamed over Zoom, with all lecture recordings made available shor tly after class (use of 2 computer s)  No mandator y graded in class activities this quarter to maximize attendance/par ticipation flexibility for covid and commuting – (enables mostly asynchronous par ticipation)  OBS Studio software used to provide dif ferent “scenes” that integrate dif ferent screen captures with camera, chat, and displays  Slide refinements to improve online deliver y  Assignment 3 graded as a Quiz/Tutorial: Kernel Module programming  Extra credit for paperless daily feedback sur veys  Tutorial 3 on File Systems optional for extra credit  Assignment 2– new assignment, single producer, single consumer, multiple buf fer provides revised scope for covid - 19, with primar y focus on pthreads, locking, and bounded buf fer December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 3 COURSE EVALUATION: TCSS 422 A FALL 2021

 Questions from 12 / 7

 Assignment 3 : (Tutorial) Introduction to Linux Kernel Modules  Memory Segmentation Activity + answers (available in Canvas)  Quiz 4 – Page Tables  Final exam – December 14  Tutorial 3 - File Systems (Optional, Extra Credit)

 Chapter 21/22: Beyond Physical Memory

▪ Swapping Mechanisms, Swapping Policies

 Practice Questions for Final Exam

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 4 OBJECTIVES – 12/

School of Engineering and Technology  Please classify your perspective on material covered in today’s class (24 respondents):  1 - mostly review, 5-equal new/review, 10-mostly new  Average – 5.80 ( - previous 6.27)  Please rate the pace of today’s class:  1 - slow, 5-just right, 10-fast  Average – 5.64 ( - previous 5.58) December 9, 2021 TCSS422: Computer Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 7 MATERIAL / PACE

 What is the update on assignment grading?

 Recently graded: Active Reading Quiz Chapter 9

 Current: Tutorial 1 and Quiz 3

 Next: Assignment 2

 Remainder is online quizzes and the Final Exam

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 8 FEEDBACK

School of Engineering and Technology

 Questions from 12 / 7

 Assignment 3 : (Tutorial) Introduction to Linux Kernel Modules  Memory Segmentation Activity + answers (available in Canvas)  Quiz 4 – Page Tables  Final exam – December 14  Tutorial 3 - File Systems (Optional, Extra Credit)

 Chapter 21/22: Beyond Physical Memory

▪ Swapping Mechanisms, Swapping Policies

 Practice Questions for Final Exam

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 9 OBJECTIVES – 12/

 Assignment 3 provides an introduction to kernel

programming by demonstrating how to create a

Linux Kernel Module

 Kernel modules are commonly used to write device

drivers and can access protected operating system data

structures

▪ For example: Linux task_struct process data structure

 Assignment 3 is scored in the Quizzes / Activities /

Tutorials category

▪ Lowest two grades in this category are dropped

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 10 ASSIGNMENT 3: INTRODUCTION TO LINUX KERNEL MODULES

School of Engineering and Technology

 Questions from 12 / 7

 Assignment 3 : (Tutorial) Introduction to Linux Kernel Modules  Memory Segmentation Activity + answers (available in Canvas)

 Quiz 4 – Page Tables

 Final exam – December 14

 Tutorial 3 - File Systems (Optional, Extra Credit)

 Chapter 21/22: Beyond Physical Memory

▪ Swapping Mechanisms, Swapping Policies

 Practice Questions for Final Exam

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 13 OBJECTIVES – 12/  Tuesday December 14 from 1:30 to 3:30 pm ▪ Final (100 points) ▪ SHORT: similar number of questions as the midterm ▪ 2 - hours ▪ Focus on new content - since the midterm (~70% new, 30% before)  Final Exam Review - ▪ Complete Memory Segmentation Activity ▪ Complete Quiz 4 ▪ Practice Final Exam Questions – 2 nd^ hour of Dec 9th^ class session ▪ Individual work ▪ 2 pages of notes (any sized paper), double sided ▪ Basic calculators allowed ▪ NO smartphones, laptop, book, Internet, group wowkr December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 14 FINAL EXAM – DEC 14TH

School of Engineering and Technology

 Questions from 12 / 7

 Assignment 3 : (Tutorial) Introduction to Linux Kernel Modules  Memory Segmentation Activity + answers (available in Canvas)

 Quiz 4 – Page Tables

 Final exam – December 14

 Tutorial 3 - File Systems (Optional, Extra Credit)

 Chapter 21/22: Beyond Physical Memory

▪ Swapping Mechanisms, Swapping Policies

 Practice Questions for Final Exam

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 15 OBJECTIVES – 12/

 Questions from 12 / 7

 Assignment 3 : (Tutorial) Introduction to Linux Kernel Modules  Memory Segmentation Activity + answers (available in Canvas)

 Quiz 4 – Page Tables

 Final exam – December 14

 Tutorial 3 - File Systems (Optional, Extra Credit)

 Chapter 21/22: Beyond Physical Memory

▪ Swapping Mechanisms, Swapping Policies

 Practice Questions for Final Exam

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 16 OBJECTIVES – 12/

School of Engineering and Technology

 Provide the illusion of an address space larger than

physical RAM

 For a single process

▪ Convenience

▪ Ease of use

 For multiple processes

▪ Large virtual memory space supports running

many concurrent processes...

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 19 MOTIVATION FOR EXPANDING THE ADDRESS SPACE December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 20 LATENCY TIMES

 Design considerations:

▪ SSDs 4x the time of DRAM

▪ HDDs 80x the time of DRAM

Latency numbers ever y programmer should know  From: https://gist .gi th ub .c om /j bo ne r/ 2 841 83 2#f il e - la ten cy - tx t

School of Engineering and Technology

 Questions from 12 / 7

 Assignment 3 : (Tutorial) Introduction to Linux Kernel Modules  Memory Segmentation Activity + answers (available in Canvas)

 Quiz 4 – Page Tables

 Final exam – December 14

 Tutorial 3 - File Systems (Optional, Extra Credit)

 Chapter 21/22: Beyond Physical Memory

▪ Swapping Mechanisms, Swapping Policies

 Practice Questions for Final Exam

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 21 OBJECTIVES – 12/

 Disk space for storing memory pages

 “Swap” them in and out of memory to disk as needed

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 22 SWAP SPACE

School of Engineering and Technology

 Memory pages are:

▪ Stored in memory

▪ Swapped to disk

 Present bit

▪ In the page table entry (PTE) indicates if page is present

 Page fault

▪ Memory page is accessed, but has been swapped to disk

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 25 PAGE LOCATION

 OS steps in to handle the page fault

 Loading page from disk requires a free memory page

 Page-Fault Algorithm

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 26 PAGE FAULT

School of Engineering and Technology

 Page daemon

▪ Background threads which monitors swapped pages

 Low watermark (LW)

▪ Threshold for when to swap pages to disk

▪ Daemon checks: free pages < LW

▪ Begin swapping to disk until reaching the highwater mark

 High watermark (HW)

▪ Target threshold of free memory pages

▪ Daemon free until: free pages >= HW

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 27 PAGE REPLACEMENTS

 Questions from 12 / 7

 Assignment 3 : (Tutorial) Introduction to Linux Kernel Modules  Memory Segmentation Activity + answers (available in Canvas)

 Quiz 4 – Page Tables

 Final exam – December 14

 Tutorial 3 - File Systems (Optional, Extra Credit)

 Chapter 21/22: Beyond Physical Memory

▪ Swapping Mechanisms, Swapping Policies

 Practice Questions for Final Exam

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 28 OBJECTIVES – 12/

School of Engineering and Technology  What if: ▪ We could predict the future (… with a magical oracle) ▪ All future page accesses are known ▪ Always replace the page in the cache used farthest in the future  Used for a comparison  Provides a “best case” replacement policy  Consider a 3-element empty cache with the following page accesses:

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 31 OPTIMAL REPLACEMENT POLICY

What is the hit/miss ratio?What is the hit/miss ratio?

6 hits6 hits

 Queue based

 Always replace the oldest element at the back of cache

 Simple to implement

 Doesn’t consider importance… just arrival ordering

 Consider a 3-element empty cache with the following

page accesses:

 What is the hit/miss ratio?

 How is FIFO different than LRU?

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 32 FIFO REPLACEMENT

4 hits4 hits

LRU incorporates historyLRU incorporates history

School of Engineering and Technology  Pick a page at random to replace  Simple and fast implementation  Performance depends on luck of random choices

December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 33 RANDOM REPLACEMENT  LRU: Least recently used  Always replace page with oldest access time (front)  Always move end of cache when element is read again  LRU requires constant reorganization of the cache  Considers temporal locality ( when pg was last accessed ) 0 1 2 0 1 3 0 3 1 2 1        December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 34 HISTORY-BASED POLICIES

What is the hit/miss ratio?What is the hit/miss ratio?

6 hits6 hits

School of Engineering and Technology December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 73 December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 83

School of Engineering and Technology  No-Locality (Random Access) Workload ▪ Perform 10,000 random page accesses ▪ Across set of 100 memory pages December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 39 WORKLOAD EXAMPLES: NO-LOCALITY When the cache is large enough to fit the entire workload, it doesn’t matter which policy you use.  80/20 Workload ▪ Perform 10,000 page accesses, against set of 100 pages ▪ 80% of accesses are to 20% of pages (hot pages) ▪ 20% of accesses are to 80% of pages (cold pages) December 9, 2021 TCSS422: Operating Systems [Fall 2021] School of Engineering and Technology, University of Washington - Tacoma L18. 40 WORKLOAD EXAMPLES: 80/ LRU is more likely to hold onto hot pages (recalls history)