paging Flashcards

1
Q

why do we create a hierarchy of page translations (multilevel paging)

A

v few processes will require access to every single page in the system so we only store the ones currently in use for the process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what does the address look like for multilevel paging

A

upper bits = index to page directory
next set of bits = index in the page table (which shows the frame number)
lower bits = offset in the frame

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what does the page directory contain

A

pointers to the next level of pages in the hierarchy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

in a 32 bit machine using multilevel paging how are the address bits split up

A

10 = page directory
10 = page table
12 = offset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what are 2 negatives of using 64 bit architecture

A

requires much larger pages
inefficient due to internal fragmentation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how can we make 64 bit architectures with multilayer paging more efficient

A

not letting the hierarchy get too deep and therefore having larger page sizes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are two alternatives to 64 bit architecture with multilayer paging

A

hashed page tables
inverted page tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

how do inverted page tables work

A

the table has one entry for each frame and one table is used for all processes
the process id is included in the address and a search if done with the pid combined with the page number
the position in the table if the frame number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is a positive fo inverted page tables

A

reduces the number of memory accesses and transaltions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is a negative and positive of hashed page tables

A

more expensive access however if there are few entries in the list then its more efficient than going through all the hierarchies in a 64 bit machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

how do hashed page tables work

A

the page number is hashed which represents the index to a smaller page table
the table stores a pointer to a list of page table entries with the same hash value
the list is scanned for the page number we want

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is the point of demand paging

A

allows you to add more pages to a process whilst its running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

how does demand paging work

A

a process initially hasno memory
every time a process tries to access an area of memory without a translation in the page table, you get a PAGE FAULT
if the operation is illegal then the process is stopped
if legal then we allocate more memory to the process, which adds another page to the table and we rerun the last instruction ( the one that caused the page fault)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what causes a page fault

A

when a process tries to access an area of memory without a translation in the page table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what happens when you get a page fault

A

an interrupt is called and the page fault interrupt handler is invoked

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how does demand paging allow scalability

A

every time the process accesses a new page, we can add the into the mapping for the process

17
Q

what is a benefit of shared memory

A

dont have to duplicate libraries for multiple processes and instead just map the translations to the same memory location

18
Q

what are the permissions for a shared library

19
Q

what is the role of the translation lookaside buffer (tlb)

A

a hybrid of memory and hybrid based page tables which is a cache of mappings

20
Q

what are the pros and cons if register based page tables

A

fast but limited capacity as registers are expensive

21
Q

what are the pros and cons if memory based page tables

A

the capacity is only limited by memory
slow access time as its also translated via tables

22
Q

what is the benefit of tlb

A

locality so faster access

23
Q

how does the tlb work with multiple processes

A

we store the process id with each entry so when we get a tlb hit we make sure to also match the pid

24
Q

why do we want to use the tlb with multiple processes

A

so that we dont have to flush the cache each time we switch processes as translations are only valid per process

25
Q

how does retrieving a frame from the tlb work

A

if the page number is stored then we have a tlb hit so we get the frame number
if its a miss then we simply get the frame the way that we usually would then insert the entry into the tlb

26
Q

how do we speed up the creation of new processes

A

when we create a child process we duplicate the page tables so the child shares all the same mappings as the parent
we mark all pages as read only (but remember which were writable)
whenever the parent/child tries to execute we get a PAGE FAULT
we then duplicate the memeory corresponding to the frame thats being accesses
we return the permissions but now the parent and child can write to different frames

27
Q

how do we remember which pages were writable when creating a new child process

A

using a spare bit in the page table

28
Q

what is the benefit of “speeding up” creating a new process

A

we only incur overhead of copying new memory when we actually need to execute / write something

29
Q

why do we need to “speed up” creating processes (old method)

A

when we create a child, we call exec() immediately after which replaces all the child’s processes with the one of the application
therefore we are simply duplicating the parent just to throw it away