CS300 Exam 2

Ace your homework & exams now with Quizwiz!

Free Space Management Strategies

*First-fit* always starts the search from the beginning of the list and allocates the first hole large enough to accommodate the request. *Next-fit* starts each search at the point of the last allocation. *Best-fit* searches the entire list and chooses the smallest hole large enough to accommodate the request. *Worst-fit* takes the opposite approach from best-fit by always choosing the largest available hole for any request.

Segmentation vs Paging

*Paging* one contiguous address space, equal-sized partitions where each virtual page is mapped to a physical frame. *Segmentation* providing multiple logical address spaces for each process, where each segment can have a different size. *Advantages* segmentation: the ability to create multiple variable-size address spaces. paging: the ability to place any page into any frame in memory *Disadvantages* paging: external fragmentation segmentation: internal fragmentation.

Which of the following statements are true of the TLB?

*a*. The TLB is implemented with hardware b. Flushing the TLB on context switch replaces the need for ASID c. The TLB valid bit is copied from the page table valid bit *d*. TLB improves address space translation performance due to temporal locality Answer A and D

If 10 bits of the logical address are reserved for the offset, what is the page size in whole numbers?

2¹⁰ = 1024 words For an address size of v bits, a process has a page size of 2ᵛ

In a non-paged address translation, if the base register contains 0x52000000 and the limit register contains 0x00008000 a. How big is the address space allocated to the process? b. Is 0x00004000 a valid logical address? c. Is 0x52000001 a valid logical address?

Answer a. 0x00008000 b. Yes c. No

What part of the MMU adds protection during contiguous allocation?

Bounds register provides protection by checking if memory references are within bounds.

What is the advantage of abstracting the process address space to logical addressing? Explain why this is an advantage. Be specific and use operating system terms in your answer.

By abstracting the process address space memory may be managed more efficiently. Allowing access to physical addresses places the burden of memory optimization on the programmer. Moreover memory almost certainly performs better in a real world system when it is allowed to choose its physical address at runtime (prevent faulting)

Determine the number of page faults and the frame contents for the reference list using each page replacement algorithm

FIFO selects the page that has been resident in memory for the longest time. Optimal selects the page that will not be referenced for the longest time in the future. Guaranteed the smallest number of page faults. LRU selects the page that has not been referenced for the longest time.1) Whenever a resident page p is referenced, p is moved to the end of the queue. Thus the queue is always sorted from most recently used page to least recently used page.2) When a non-resident page p is referenced, p is moved to the end of the queue and the least recently referenced page q at the head of the queue is removed. Page p then replaces q in memory.

(T/F) Best fit and first fit find a candidate memory partitions in similar times

False

(T/F) Slab allocators are designed to make coalescing easier

False Buddy allocation makes coalescing easier. Segregated lists (slab allocator) lowers the concern of fragmentation.

Why might first-fit be better than worst-fit?

First fit might be better if the processes vary in size with multiple larger blocks. Worst fit would fill up large holes first, and have no room when large blocks come.

Implicit

Hardware determines the segment based on how the address was formed.

What is the advantage and disadvantage to using larger pages?

Larger pages mean smaller page tables and less I/O, but more internal fragmentation.

What is stored in the page table that assists with optimizing page table replacement? Explain its function.

Modified bit indicates whether corresponding page has been modified to minimize movement to disk

In free space management, what approach prioritizes coalescence oversearch for a partition?

Next-fit uses less exhaustive search and spreads the list more uniformly allowing easier coalescence .

Does using a pure segmentation based memory approach address external fragmentation? Why or why not?

No, as memory is allocated and deallocated there is nothing controlling the size or location of uncontrolled memory.

Inverted Page Table

Page table which has one entry for each frame of memory. Entries consist of the virtual address of the page stored in the frame. A single page table is used to represent the paging information of all the processes. *Advantages* • Reduced memory space • only fixed portion of memory is required to store paging information for all processes *Disadvantages* • Longer lookup time • Difficult to share memory

Can the TLB contain entries from more than one process? Why or why not?

TLB contains virtual-to-physical translations that are only valid for the currently running process.

Name two factors that can be used to choose/more efficiently vary the allocation of frames given to a process.

Temporal locality - preserve recently used memory in hopes it will be used again soon Spatial locality - preserve memory locations in close proximity to recently used memory in hopes it will be used soon

What is thrashing? Can local page replacement fix thrashing? Why or why not?

Thrashing is when a program does not have enough frames and frequently has to replace. Page replacement helps by keeping thrashing programs isolated, but the thrashing program will still be constantly in the queue thus slowing down other programs.

What is a ASID?

To reduce the overhead of flushing the TLB after each context switch, some systems add hardware support to en-able sharing of the TLB across context switches

What is a TLB?

Translation Look-Aside Buffer is a memory cache that stores recent translations of virtual memory to physical addresses for faster retrieval

(T/F) Compaction can be used to address external fragmentation

True Compaction is the systematic shifting of modules in memory, generally in one direction, to consolidate multiple disjoint holes into one larger hole.

Does using a pure segmentation based memory approach address the issue of sparse address spaces? Why or why not?

Yes

What is external fragmentation?

a situation in which the dynamic allocation of memory creates unusable fragments of free memory between blocks of busy, or allocated, memory

Which of the following fields are likely to be used in a hierarchical page table?

a. ACID b. Valid bit c. Reference bit d. Present bit Answer Could be a or c

Which of the following are more difficult in an inverted page table vs hierarchical page table?

a. Finding space for additional processes *b*. Quickly identifying the physical page number using the vertical address space *c*. Sharing read only code d. Moving a process memory from one physical page to different physical page Answer b and c

Which of the following actions are part of a hardware-based page fault service routine?

a. Look up logical page in TLB b. Look up un-cached logical address in page table *c*. Write any modified victim page to disk d. Restart execution with instruction following instruction that triggered the page fault Answer c and maybe d

What is internal fragmentation?

allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used

Hierarchical page table

divides page table into page-sized groups of entries pointed to by a page directory; *Advantages* • reduces page table size by not allocating pages of the page table if none of its entries are used; • allows groups of PTEs to be placed non-contiguously (level of indirection) *Disadvantages* • increases complexity and incurs time-space trade-off (as more memory accesses have to be done with each level of indirection)

Explicit

uses the most significant bits to tell what segments and thus what base value to use


Related study sets

N-10-007 Objective 1 Practice Questions

View Set

Chapter 24 - Structure and Function of the Liver

View Set

Final Study Guide - Economics (Bunger)

View Set

SOCI 1251 Revel Chapter 11 Quiz Questions

View Set

AP Stats Chapter 1- Exploring Data

View Set

500 SHRM-SCP Exam Study Prep 1200+

View Set

Chapter 28: Care of Patients Requiring Oxygen Therapy or Tracheostomy

View Set

Fortnite, Stump Mr. Wagner, Greece

View Set