I want to find the size of my tlb programmatically (C language). Ubuntu 14.04 LTS cpuid gives: data TLB: 2M/4M pages, 4-way, 32 entries data TLB: 4K pages, 4-way, 64 entries But, the data i got is having rise after 16 entries. For this, I am filling an array with integers and using mmap. Then, accessing every 1024th entry as page size is 4kb and integers is 4bytes so (1024 * 4B = 4KB). So, the rise should be after 64 entries, as my TLB has 64 entries, but I am receiving miss after every 16 entries. What I perceive is, this is because of 4-way associative TLB WHICH GIVES 64 entries / 4-way associativity = 16. Kindly guide me if my perception is right or is my approach wrong and I should get miss after 64 entries.
Asked
Active
Viewed 354 times
0
-
1What OS? Makes a difference. – Flexo Apr 25 '16 at 18:05
-
You can consider alternate approaches like using `cpuid` instruction through inline assembly. Check the question part of https://stackoverflow.com/questions/10699393/how-to-get-tlb-page-size-with-cpuid – iVoid Dec 12 '18 at 04:41