Add the rest of university notes

This commit is contained in:
John Gatward committed 2026-10-04 14:02:35 +01:00
1 parent c1b84c7f7d
commit d0f27f276b
366 files changed
+9844 -110

No files matched your search

+9 -7
View File
@@ -18,7 +18,7 @@
* The principle behind TLBs is similar to other types of **caching in operating systems**. They normally store anywhere from 16 to 512 pages.
* Remember: **locality** states that processes make a large number of references to a small number of pages.
![TLB diagram](/lectures/osc/assets/W.png)
![TLB diagram](assets/w.png)
The split arrows going into the TLB represent searching in parallel.
@@ -42,15 +42,19 @@ The split arrows going into the TLB represent searching in parallel.
> * Performance evaluation of TLBs
>
> * For an 80% hit rate, the estimated access time is:
>
> $$
> 120\cdot 0.8 + 220\cdot (1-0.8)=140ns
> $$
>
> (**40% slowdown** relative to absolute addressing)
>
> * For a 98% hit rate, the estimated access time is:
>
> $$
> 120\cdot 0.98 + 220\cdot (1-0.98)=122ns
> $$
>
> (**22% slowdown**)
>
> NOTE: **page tables** can be **held in virtual memory** => **further slow down** due to **page faults**.
@@ -68,8 +72,6 @@ A **normal page table size** is proportional to the number of pages in the virtu
>* *Solution*: Use a **hash function** that transforms page numbers (*n* bits) into frame numbers (*m* bits) - Remember *n* > *m*
> * The has functions turns a page number into a potential frame number.
![inverted page table](/lectures/osc/assets/x.webp)
So when looking for the page's frame location. We have to sequentially search through the table until we hit a match, we then get the frame number from the index - in this case 4.
#### Inverted Page Table Entry
@@ -80,9 +82,9 @@ So when looking for the page's frame location. We have to sequentially search th
> * **Protection** bits (Read/Write/Execute)
> * **Chaining Pointer** - This field points towards the next frame that has exactly the same VPN. We need this to solve collisions
![Inverted Page table entry](/lectures/osc/assets/Y.png)
![Inverted Page table entry](assets/Y.png)
![inverted page table address translation](/lectures/osc/assets/Z.png)
![inverted page table address translation](assets/Z.png)
Due to the hash function, we now only have to look through all entries with **VPN**: 1 instead of all the entries.
@@ -130,6 +132,7 @@ Due to the hash function, we now only have to look through all entries with **VP
NOTE: This doesn't take into account TLBs.
The expected access time is **proportional to page fault rate** when keeping page faults into account.
$$
T_{a} \space\space\alpha \space\space p
$$
@@ -160,9 +163,8 @@ $$
>
> This is a pretty bad algorithm <s>unsurprisingly</s>
![FIFO page replacement](/lectures/osc/assets/a1.png)
![FIFO page replacement](assets/a1.png)
Explanation at 53:40
Shaded squares on the top row are page faults. Shaded squares in the grid are when a new page is brought into memory.