These problems should be done on your own. They are not to be turned in. Getting help from AI (besides being ruled out by the course policies) will actually hurt you, since the point of these questions isn’t so you can deliver an answer somewhere and check a box; it’s for you to gain the practice and experience of working through the problems. You will need that general skill (of absorbing something by practicing it) in life, and in this semester you will need the specific problem-solving skills that are emphasized in these homeworks.
Scheduling
This question is open-ended; there are many possible answers. You don't have to type very much, and you can think about these questions even when you are not in front of a computer.
There are many metrics that a scheduler has to balance: turnaround time, response time, throughput, and various definitions of fairness. We will consider the following types of systems in this question:
- A high-performance computer used for large number crunching tasks (genetic sequencing, graphics rendering...)
- A multimedia computer (video games, movies...)
- A smartphone
- A general-purpose computer on a corporate desktop
- For each of the system types above, which metrics do you think are the most important, and why? Some things to consider: How many users does the system have? Are user processes typically interactive? How long is a user willing to wait? What frustrations will users have if certain metrics are ignored? (There are many possible answers to this question.)
- Taking into consideration your answers above, propose a scheduling policy (FIFO, etc.) for each system above.
- For each of the systems above, what is the scheduling policy that would most completely undermine the purpose of the system?
Virtual memory: warmup
This question is borrowed from CS:APP3e [Computer Systems: A Programmer’s Perspective (Third Edition), by Randy Bryant and David R. O’Hallaron].
Complete the following table, filling in the missing entries and replacing each question mark with the appropriate integer. Use the following units: K = 210 (kilo), M = 220 (mega), G = 230 (giga), T = 240 (tera), P = 250 (peta), or E = 260 (exa).
Number of virtual address bits | Number of virtual addresses | Largest possible virtual address |
---|---|---|
4 | 16 | 16 − 1 = 15 |
8 | ____ | ____ |
____ | 2? = 64 K | ____ |
____ | ____ | 232 − 1 = ? G - 1 |
____ | 2? = 256 T | ____ |
64 | ____ | ____ |
Virtual memory: paging
This question is also borrowed from CS:APP3e.
Determine the number of page table entries (PTEs) that are needed for the following combinations of virtual address size (n) and page size (P).
n | P | Number of PTEs |
---|---|---|
16 | 4K | ____ |
16 | 8K | ____ |
32 | 4K | ____ |
32 | 8K | ____ |
48 | 4K | ____ |
Virtual memory: address translation
This question is also borrowed from CS:APP3e, and lightly modified.
Given a 32-bit virtual address space and a 24-bit physical address, determine the number of bits in the VPN, PPN (your book, OSTEP, calls this PFN), and offset, for the following page sizes P:
P | # of VPN bits | # of PPN bits | # of offset bits |
---|---|---|---|
1 KB | ____ | ____ | ____ |
2 KB | ____ | ____ | ____ |
4 KB | ____ | ____ | ____ |
8 KB | ____ | ____ | ____ |