+ All Categories
Home > Documents > CS 162 Discussion Section Week 6

CS 162 Discussion Section Week 6

Date post: 30-Dec-2015
Category:
Upload: bradley-mullen
View: 22 times
Download: 0 times
Share this document with a friend
Description:
CS 162 Discussion Section Week 6. Administrivia. Project 2 Deadlines Initial Design Due: 3/1 Review Due: 3/5 Code Due: 3/15. Project 2 Overview. Part I – Implement file system calls like create, open, read, write, close etc. Part II – Implement support for multiprogramming - PowerPoint PPT Presentation
21
CS 162 Discussion Section Week 6
Transcript
Page 1: CS 162 Discussion Section Week 6

CS 162Discussion Section

Week 6

Page 2: CS 162 Discussion Section Week 6

Administrivia

• Project 2 Deadlines– Initial Design Due: 3/1– Review Due: 3/5– Code Due: 3/15

Page 3: CS 162 Discussion Section Week 6

Project 2 Overview

• Part I – Implement file system calls– like create, open, read, write, close etc.

• Part II – Implement support for multiprogramming– Play with allocating memory, virtual memory

• Part III – Implement system calls– like exec, join and exit

• Part IV – Implement lottery scheduling

Page 4: CS 162 Discussion Section Week 6

Recap

Why do we have a virtual address space?

Page 5: CS 162 Discussion Section Week 6

Recap

How is a virtual address translated into a physical address?

Page 6: CS 162 Discussion Section Week 6

Recap

Why do we have multiple levels of page tables?

Page 7: CS 162 Discussion Section Week 6
Page 8: CS 162 Discussion Section Week 6

What is the size of the page table in a 64bit system if each

page is 4K in size? – 16 PB

How many levels would you need if you had 1024 entry

page tables?

Page 9: CS 162 Discussion Section Week 6

TLB

• Caching Applied to Address Translation

Page 10: CS 162 Discussion Section Week 6

Caching

• caching is to store copies of data at places that can be accessed more quickly than accessing the original.

• Locality:– Temporal locality• Example: recently accessed files

– Spatial locality• Example: ls command

Page 11: CS 162 Discussion Section Week 6

Memory Hierarchy

Image Source: http://www.sal.ksu.edu/faculty/tim/ossg/

Page 12: CS 162 Discussion Section Week 6

Issues in Caching

• Cache Hit• Cache Miss• effective access time is defined with the

following equation:

T = P(cache hit)*(cost of hit) + P(cache miss)*(cost of miss)

Page 13: CS 162 Discussion Section Week 6

Problem

What is the effective access time for TLB with 80% hit rate, 20ns TLB access time and 100 ns Memory access time (assume two-level page table that is not in L2 cache)?

Page 14: CS 162 Discussion Section Week 6

Is there any way to make the page table smaller?

Page 15: CS 162 Discussion Section Week 6

Linear inverted page tables

Page 16: CS 162 Discussion Section Week 6

Hashed inverted page table

Page 17: CS 162 Discussion Section Week 6

Hashed inverted page table

Page 18: CS 162 Discussion Section Week 6

Design Issues in Caching

• The design of a caching mechanism needs to answer the following questions:

– How is a cache entry lookup performed? – If the data is not in the cache, which cache entry

should be replaced? – How does the cache copy maintain consistency with

the real version of data?

Page 19: CS 162 Discussion Section Week 6

Types of Cache

• Direct Mapped Cache• Fully Associative Cache• N way Set Associative Cache

Page 20: CS 162 Discussion Section Week 6
Page 21: CS 162 Discussion Section Week 6

2-Way Associative Cache in TLB


Recommended