• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/39

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

39 Cards in this Set

  • Front
  • Back

An entire program does need to be in memory in order to run. Why not?

Programs contain a lot of code that is only needed in edge cases (i.e. to handle errors) and large data structures where only parts are needed

What are the two ways in which Virtual Memory can be implemented?

- Demand Paging


- Demand Segmentation

Without virtual memory, how much of the program code must be loaded into memory at execution time?

All of it.

Virtual memory enables execution of multiple processes to proceed much faster. Why?

Because virtual memory allows only the important parts of a program to live on the memory, meaning you can fit more programs on at once. Without VM, programs are always getting kicked off memory and put back on, which requires expensive I/O

What is "pure swapping"?

When an entire process is transferred at once from disk to memory

What is "demand paging"?

Bringing a page (of a process) into memory only when it is needed

How does Demand Paging react if the page requested is already in memory (aka "memory resident")?

Exactly the same as regular paging. It just retrieves that page. No swaps needed.

What do V and I bits stand for?

Valid / Invalid

Suppose no pages were loaded into memory yet. The MMU receives a request for Page 532. The MMU goes to the Page Table to look up the physical address for this frame. What will it find?

Garbage, followed by an INVALID bit, indicating the frame currently there is junk.

What is a page fault?

When the requested frame is not memory resident

Give three situations that can result in a page fault:

1) Program just started. Any frame requested will result in a fault


2) The requested frame was not loaded into memory


3) The requested frame was loaded into memory but replaced by another frame and its valid bit set to invalid

Besides a page fault, what else can "go wrong" when a page request is sent to the MMU?

The address could be invalid, in which case the request is aborted

True or False: When a page fault occurs, the OS looks for the page on the backing store and brings it into physical memory.

True (Slide 11)

What is meant by locality of reference?

Data is likely to be accessed if the data nearby is accessed.

True or False: Demand Paging requires specialized hardware

Well... page tables CAN be virtualized but it's far more efficient for them to be implemented with special hardware, special swap memory, and instruction restart.

What is the most expensive step of the Demand Paging process, when a the page is memory resident?

Reading the page. (servicing the interupt and restarting the process require only a small amount of time)

What happens if all of physical memory is full and a page fault occurs?

A page replacement algorithm must be used to replace determine which page should be discarded to make room for the new page

In the event of a page fault, two page transfers may be required. Why?

One to write the old page (the victim) into backing store and one to read the new one into memory

What does a Frame Allocation algorithm do?

Determines how many frames to give a process

What is the goal of a page replacement algorithm?

To minimize the number of page faults that occur.

What is the optimal page replacement algorithm?

To pick a victim page, pick the page will not be used for the longest time


(Problem: we don't know which that will be)

What are the two page replacement algorithms discussed?

1) FIFO

2) LRU

What's the difference between a page and a frame?

A frame is what a page is put into

What are the new major schemes for frame allocation?

1) Fixed Allocation


2) Priority Allocation

What are two variations of the Fixed Allocation scheme for frames?

1) Equal Allocation (frames are divided up amongst processes equally)


2) Proportional Allocation (processes are given a share of frames based on their size. i.e. if Process-A is double the size of Process-B and there are 30 frames in memory, A will get 20 and B will get 10.

What is the Priority Allocation scheme for frames?

Give more frames to higher priority processes. In the event of a page fault, the victim frame should be from a lower priority process.

What is the difference between Global Allocation and Local Allocation (for frames)?

Global Allocation can mark a frame from another process as a victim for the current process' incoming frame (more commonly used).

Local Allocation only allows selecting victim frames the current process.


What is the advantage and disadvantage of Global Allocation?

Advantage: higher throughput


Disadvantage: performance can vary greatly

What is the advantage and disadvantage of Local Allocation?

Advantage: more consistent per-process performance


Disadvantage: possible underutilized memory

What is "thrashing"?

When page faults happen extremely often, such that the computer is doing more of swapping pages than actual work.

How can demand paging prevent thrashing?

By using the locality model - that is, only penalize processes that don't have good locality (a process that jumps around a lot and whose pages aren't necessarily relevant to eachother)

what is the benefit offered by Memory-Mapped Files?

Allows files to be accessed and written to as fast as memory

What system call would you use to create a memory mapped file?

mmap() (Solaris actually does this automatically)

When does data written to a memory-mapped file make it to the disk?

Periodically (e.g. when MMU scans for dirty pages) the data in memory is written back to the file on disk, and also when close() is called.

What are two strategies discussed for Kernel memory allocation?

1) Buddy System


2) Slab Allocation

True or False: The kernel is occasionally swapped out of memory and onto disk.

False, the kernel must always have memory

Some kernel memory needs to be contiguous. Give an example why

For I/O, kernel must have contiguous buffers for I/O to write into

What is the Buddy System for Memory Allocation?



What is a disadvantage of the Buddy System?

Internal Fragmentation. For example, a 33kb page will require a 64kb frame (Assuming starting with 256kb)