The page table associate each virtual page with its associated physical frame. The TLB does the same except it only contains a subset of the page table.
What is the purpose of the TLB if page table does the same thing and has more data?
The page table associate each virtual page with its associated physical frame. The TLB does the same except it only contains a subset of the page table.
The TLB is faster than main memory (which is where the page table resides). A TLB access is part of an L1 cache hit, and modern CPUs can do 2 loads per clock if they both hit in L1d cache. The reasons for this are twofold: The TLB is located within the CPU, while main memory - and thus the page table - is not.
TLB contains page table entries that have been most recently used. Given a virtual address, the processor examines the TLB if a page table entry is present (TLB hit), the frame number is retrieved and the real address is formed.
Longer memory access times (page table lookup) Can be improved using TLB. Guarded page tables. Inverted page tables.
Speed.
The TLB is a cache that holds (likely) recently used pages. The principle of locality says that the pages referenced in the TLB are likely to be used again soon. This is the underlying idea for all caching. When these pages are needed again, it takes minimal time to find the address of the page in the TLB. The page table itself can be enormous, so walking it to find the address of the needed page can get very expensive.
See https://en.wikipedia.org/wiki/Translation_lookaside_buffer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With