








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma
TCSS 422: OPERATING SYSTEMS This is a “cloud computing” course Previous year’s course: http://faculty.washington.edu/wlloyd/courses/tcss Course introduces major cloud computing delivery models: Infrastructure-as-a-Service (IaaS), Platform (PaaS), Functions (FaaS), Container (CaaS), Software (SaaS) Course features a software development project where we build and evaluate software entirely for the cloud Topics: introduction to major cloud services, developing serverless software (Function-as-a-Service), containerization FALL 2021 - TCSS 562 SOFTWARE ENG. FOR CLOUD COMPUTING June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19.
Once as a undergraduate elective towards graduation Once as a graduate elective towards the Masters in Computer Science & Systems (MSCSS) degree June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. TCSS 562 – CLOUD COMPUTING - 2 Independent study in “cloud computing” Work to collaboratively draft a proposal and submit to Dr. Nascimento, CSS Chair F 2021 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 Spring 2021: currently 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 NEXT YEAR - TCSS 498/499 (ANY QUARTER)
June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. Please complete the course evaluation survey at: TCSS 422 A - Computer Operating Systems:
Ne w t h is q uarter i n T CSS 4 22: Assignment 2– new assignment, adjusted scope for covid-19, and to focus on pthreads, locking, and bounded buffer No mandatory graded in class activities this quarter per UW request
Assignment 3: (Tutorial) Introduction to Linux Kernel Modules
Example Question
Swapping Mechanisms, Swapping Policies
w/ Soft Eng from UWT CSS Jugal and Navid (eBay and T-Mobile) June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. OBJECTIVES – 6/
Daily Feedback Quiz in Canvas – Available After Each Class Extra credit available for completing surveys ON TI ME Tuesday surveys: due by ~ Wed @ 11:59p Thursday surveys: due ~ Mon @ 11:59p June 3, 2021 TCSS422: Computer Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. ONLINE DAILY FEEDBACK SURVEY June 3, 2021 TCSS422: Computer Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. Please classify your perspective on material covered in today’s class (42 respondents): 1-mostly review, 5-equal new/review, 10-mostly new Average – 6 .37 ( - previous 6 .02) Please rate the pace of today’s class: 1-slow, 5-just right, 10-fast Average – 5 .46 ( - previous 5 .52) June 3, 2021 TCSS422: Computer Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. MATERIAL / PACE June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. FEEDBACK
Assignment 3: (Tutorial) Introduction to Linux Kernel Modules
Example Question
Swapping Mechanisms, Swapping Policies
w/ Soft Eng from UWT CSS Jugal and Navid (eBay and T-Mobile) June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. OBJECTIVES – 6/
Assignment 3 : (Tutorial) Introduction to Linux Kernel Modules
Example Question
Swapping Mechanisms, Swapping Policies
w/ Soft Eng from UWT CSS Jugal and Navid (eBay and T-Mobile) June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. OBJECTIVES – 6/
Consider a 16 MB computer which indexes memory using 4KB pages (#1) For a single level page table, how many pages are required to index memory? (#2) How many bits are required for the VPN? (#3) Assuming each page table entry (PTE) can index any byte on a 4KB page, how many offset bits are required? (#4) Assuming there are 8 status bits, how many bytes are required for each page table entry? June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. MULTI-LEVEL PAGE TABLE EXAMPLE (#5) How many bytes (or KB) are required for a single level page table? Let’s assume a simple HelloWorld.c program. HelloWorld.c requires virtual address translation for 4 pages: 1 – code page 1 – stack page 1 – heap page 1 – data segment page (#6) Assuming a two-level page table scheme, how many bits are required for the Page Directory Index (PDI)? (#7) How many bits are required for the Page Table Index (PTI)? June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. MULTI LEVEL PAGE TABLE EXAMPLE - 2 Assume each page directory entry (PDE) and page table entry (PTE) requires 3 bytes: 6 bits for the Page Directory Index (PDI) 6 bits for the Page Table Index (PTI) 8 status bits (#8) How much total memory is required to index the HelloWorld.c program using a two-level page table when we only need to translate 4 total pages? HINT: we need to allocate one Page Directory and one Page Table… HINT: how many entries are in the PD and PT June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. MULTI LEVEL PAGE TABLE EXAMPLE - 3 (#9) Using a single page directory entry (PDE) pointing to a single page table (PT), if all of the slots of the page table (PT) are in use, what is the total amount of memory a two-level page table scheme can address? (#10) And finally, for this example, as a percentage (%), how much memory does the 2-level page table scheme consume compared to the 1-level scheme? HINT: two-level memory use / one-level memory use June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. MULTI LEVEL PAGE TABLE EXAMPLE - 4 #1 – 4096 pages #2 – 1 2 bits #3 – 1 2 bits #4 – 3 bytes (12 VPN bits, 8 status bits, offset not stored) #5 – 4096 x 3 = 1 2,288 bytes (12KB) #6 – 6 bits #7 – 6 bits #8 – 192 bytes for Page Directory (PD) (64 entries x 3 bytes) 192 bytes for Page Table (PT) TOTAL = 384 bytes #9 – 64 entries, where each entry maps a 4,096 byte page With 1 2 offset bits, can address 262,144 bytes (256 KB) #10- 384/12288 = .03125 3.1 25% June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. ANSWERS
Assignment 3: (Tutorial) Introduction to Linux Kernel Modules
Example Question
Swapping Mechanisms, Swapping Policies
w/ Soft Eng from UWT CSS Jugal and Navid (eBay and T-Mobile) June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. OBJECTIVES – 6/
CHAPTER 21/22: BEYOND PHYSICAL MEMORY June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19.
June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. MEMORY HIERARCHY
June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. MOTIVATION FOR EXPANDING THE ADDRESS SPACE June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. LATENCY TIMES
Latency number s ever y programmer should know Fro m: https :/ /gis t.github.co m/ jbo ne r/ 28 41 83 2#f ile -late nc y -tx t
Assignment 3: (Tutorial) Introduction to Linux Kernel Modules
Example Question
Swapping Mechanisms, Swapping Policies
w/ Soft Eng from UWT CSS Jugal and Navid (eBay and T-Mobile) June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. OBJECTIVES – 6/
June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. SWAP SPACE
REPLACEMENT POLICIES June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19.3 7 Replacement policies apply to “any” cache Goal is to minimize the number of misses Average memory access time (AMAT) can be estimated: Consider TM = 100 ns, TD = 10ms Consider Phit = .9 (90%), Pmiss =. Consider Phit = .999 (99.9%), Pmiss =. June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. CACHE MANAGEMENT 𝐴𝑀𝐴𝑇 = 𝑃ு௧ ∗ 𝑇ெ + (𝑃ெ௦௦ ∗ 𝑇 ) Argument Meaning 𝑇ெ The cost of accessing memory (time) 𝑇 The cost of accessing disk (time) 𝑃ு௧ The probability of finding the data item in the cache(a hit) 𝑃ெ௦௦ The probability of not finding the data in the cache(a miss) 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:
June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. OPTIMAL REPLACEMENT POLICY
June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. FIFO REPLACEMENT
LRU incorporates history Pick a page at random to replace Simple and fast implementation Performance depends on luck of random choices
June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. RANDOM REPLACEMENT
June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. HISTORY-BASED POLICIES
June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19.4 3 June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19.4 4 No-Locality (Random Access) Workload Perform 10,000 random page accesses Across set of 100 memory pages June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. 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) June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. WORKLOAD EXAMPLES: 80/ LRU is more likely to hold onto hot pages (recalls history) Looping sequential workload Refer to 50 pages in sequence: 0, 1, …, 49 Repeat loop June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. WORKLOAD EXAMPLES: SEQUENTIAL Random performs better than FIFO and LRU for cache sizes < 50 Algorithms should provide “scan resistance” June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19.4 8
June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. OTHER SWAPPING POLICIES - 2 WE WILL RETURN AT 5:00PM June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19.
Assignment 3: (Tutorial) Introduction to Linux Kernel Modules
Example Question
Swapping Mechanisms, Swapping Policies
w/ Soft Eng from UWT CSS Jugal and Navid (eBay and T-Mobile) June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. OBJECTIVES – 6/ A computer system uses a simple base/bounds register pair to virtualize address spaces. For each traces fill in the missing values of virtual addresses, physical addresses, base, and/or bounds registers. In some cases, it is not possible to provide an exact value. If so, specify a range (e.g. greater than 100), or value that is not a single number. June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. QUESTION 1 – BASE AND BOUNDS June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. Q1 - 2 Consider a computer with 4 GB (2^32 ) of physical memory, where the page size is 4 KB (2^12 ). For simplicity assume than 1GB=1000MB, 1MB=1000KB, 1KB=1000 bytes (a) How many pages must be tracked by a single-level page table if the computer has 4GB (2^32 ) of physical memory and the page table size is 4 KB (2^12 )? (b) How many bits are required for the virtual page number (VPN) to address any page within this 4GB (2^32 ) memory space? (c) Assuming that the smallest addressable unit of memory within a page is a byte (8-bits), how many bits are required for the offset to refer to any byte in the 4 KB page? (d) Assuming each page table entry (PTE) requires 4 bytes of memory, how much memory is required to store the page table for one process (in MB)? June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. QUESTION 2 – SINGLE-LEVEL PAGE TABLE
(e) Using this memory requirement, how many processes would fill the memory with page table data on a 4GB computer? June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. Q2 - 2 Consider a computer with 1 GB (2^30 ) of physical memory, where the page size is 1024 bytes (1KB) (2^10 ). We would like to index memory pages using a two level page table consisting of a page directory which refers to page tables which are created on demand to index the entire memory space. For simplicity assume than 1GB=1000MB, 1MB=1000KB, 1KB=1000 bytes (a) For a two-level page table, divide the VPN in half. How many bits are required for the page directory index (PDI) in a two-level scheme? (b) How many bits are required for the page table index (PTI)? (c) How many bits are required for an offset to address any byte in the 1 KB page? June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. QUESTION 3 - TWO-LEVEL PAGE TABLE (d) Assuming each page table entry (PTE) requires 4 bytes of memory, how many extra bits are available for status bits? (e) HelloWorld.c consists of 4 memory pages. One code page, one heap page, one data segment page, and one stack segment page. How large is the two-level page table in bytes with the structure described above that could index the all 4 memory pages of HelloWorld.c? Hint: There should be 2 tables, a page director y, and a page table. (f) Assuming the same page table as for HelloWorld.c, using the exact same two-level page table, how large in bytes could the program grow to before needing to expand the page table? June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. Q3 - 2 Consider a 3-element cache with the cache arrival sequences below. Determine the number of cache hits and cache misses using each of the following cache replacement policies: June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. QUESTION 4 – CACHE TRACING June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. Q4 - 2 Free space management involves capturing a description of the computer’s free memory using a data structure, storing this data structure in memory, and OS support to rapidly use this structure to determine an appropriate location for new memory allocations. An efficient implementation is very important when scaling up the number of operations the OS is required to perform. Consider the use of a linked list for a free space list where each node is represented by placing the following structure in the header of the memory chunk: typedef struct __node_t { int size; struct __node_t *next; } node_t; June 3, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L19. QUESTION 5 – FREE SPACE MANAGEMENT