Top Banner
Discussion Week 6 TA: Kyle Dewey
23

Discussion Week 6

Jan 03, 2016

Download

Documents

Discussion Week 6. TA: Kyle Dewey. Overview. Project #2 questions Project #2 test cases Exam sample questions Project #3 high level overview. Project #2 Error Conditions. Do not worry about error codes Still should check for error conditions for your own testing. Project #2 Questions?. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Discussion Week 6

Discussion Week 6TA: Kyle Dewey

Page 2: Discussion Week 6

Overview

•Project #2 questions

•Project #2 test cases

•Exam sample questions

•Project #3 high level overview

Page 3: Discussion Week 6

Project #2 Error Conditions

•Do not worry about error codes

•Still should check for error conditions for your own testing

Page 4: Discussion Week 6

Project #2 Questions?

Page 5: Discussion Week 6

Project #2 Test Cases

•In code/test

•These will be used to test your code, along with similar variants of them

•Altogether, they have wide coverage

Page 6: Discussion Week 6

Some Cases

•fork.c

•ncat.c

•test1.c

Page 7: Discussion Week 6

Exam Sample Questions

Page 8: Discussion Week 6

Question: “Do OSes actually swap anything

anymore?”

Page 9: Discussion Week 6

Relevance

•Modern systems have tons of memory

•Usually a lot more free memory than in use

•Setups vary widely

Page 10: Discussion Week 6

Memory Usage

•Linux has the free command

•Shows free and used memory, along with swap

Page 11: Discussion Week 6

Occasional Webserver

total used free shared buffers cachedMem: 3962 3782 179 0 181 3009-/+ buffers/cache: 591 3370Swap: 1983 0 1983

Page 12: Discussion Week 6

Occasional Fileserver

total used free shared buffers cachedMem: 496 481 14 0 270 65-/+ buffers/cache: 144 351Swap: 792 1 790

Page 13: Discussion Week 6

CSIL Under Load

total used free shared buffers cachedMem: 8072 7493 579 0 277 3292-/+ buffers/cache: 3923 4149Swap: 12229 205 12023

Page 14: Discussion Week 6

Server After Load Spike

total used free shared buffers cachedMem: 8002 7697 304 0 2098 4652-/+ buffers/cache: 946 7055Swap: 1811 353 1458

Page 15: Discussion Week 6

Virtualization

•Multiple OSes feed off the same memory

•Memory tends to be the greatest limitation

•Special software used to force OS to page in one VM when another is starved for memory

Page 16: Discussion Week 6

Virtualized Memory

OS1OS1 OS2OS2

MachineMachine4 GB total

4 GB total 4 GB total

Needs 3 GB Needs 2 GB

Page 17: Discussion Week 6

On Paging

•Paging is a last resort mechanism

•A private, lightly loaded system will likely never need it

•In enterprise environments, it ranges from very nice to absolutely vital

Page 18: Discussion Week 6

Project #3 Overview

Page 19: Discussion Week 6

Part I

•Need to implement paging

•Tests will be so large as to need paging

•Paging algorithm cannot be naive

•Least recently used (LRU)

•Second chance FIFO queue

Page 20: Discussion Week 6

FIFO Queue

Page 1Page 1 Page 2Page 2 Page 3Page 3 Page 4Page 4

Page 2Page 2 Page 3Page 3 Page 4Page 4 Page 5Page 5

Oldest Page Newest Page

Page swapped in

Oldest Page Newest Page

Page 21: Discussion Week 6

FIFO + Second Chance

Page 1Page 1Ref: trueRef: true

Page 2Page 2Ref: trueRef: true

Page 3Page 3Ref: falseRef: false

Page 4Page 4Ref: trueRef: true

Page 4Page 4Ref: trueRef: true

Page 1Page 1Ref: falseRef: false

Page 2Page 2Ref: falseRef: false

Page 5Page 5Ref: trueRef: true

Page swapped in

Page 22: Discussion Week 6

Part 2

•Make the NACHOS filesystem more useful

•Will be using the NACHOS disk for this

•Flat file hierarchy

Page 23: Discussion Week 6

Part 2

•Implement Create(), Open(), Remove(), List(), Seek(), Read(), ReadAt(), Write(), WriteAt(), and Length()