TLB(8)

πŸ’… TLB(8) β€” tlb, from the LMBENCH fam

okay bestie so this is tlb, a section 8 (admin/sysadmin-core) manpage, and it's literally here to figure out your TLB. no cap. let's get into it πŸ’–


✨ NAME ✨

tlb β€” TLB size and latency benchmark πŸ¦‹


🌸 SYNOPSIS 🌸

tlb [ -L <line size> ] [ -M <len> ] [ -W <warmups> ] [ -N <repetitions> ]

πŸ’œ DESCRIPTION πŸ’œ

so tlb is out here trying to figure out the size, in pages, of the TLB. and like, the biggest amount of memory it will ever look at is len bytes. that's the ceiling, girl. πŸŽ€

here's the vibe: tlb compares the memory latency for two different pointer chains. both chains are chilling in the exact same amount of cache space, but bestie, they stress the memory subsystem in completely different ways. the first chain hits one word per page. the second chain is unhinged β€” it randomly jumps through all the lines on a page before it hops over to the next page. it's giving chaos. πŸ™ˆ

now, when all the pointers are sitting in the cache (which, ngl, is the usual situation) and all the pages for that first chain are living in the TLB, the average memory latencies should be identical. twins. same energy. πŸ‘‘

but β€” assuming there's a fixed size TLB β€” at some point the number of pages accessed by the first page will be larger than the TLB. and at that point? the average latency for each memory access on the first chain becomes a cache hit plus some fraction of a TLB miss. it's over for her 😭

once the TLB boundary has been located, tlb reports the TLB miss latency as the TLB latency for twice as many pages as the TLB can hold. periodt.


πŸ’€ BUGS πŸ’€

ngl tlb is an experimental benchmark, but honestly it seems to work well on most systems. slay.

but heads up bestie β€” if a processor has a TLB hierarchy, tlb only finds the top level TLB. that's it. that's all you're getting. πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘


🫢 AUTHOR 🫢

Carl Staelin and Larry McVoy

comments, suggestions, and bug reports are always welcome πŸ’Œ (they literally said it, we're just relaying the message)


(c)2000 Carl Staelin and Larry McVoy $Date$

and that's the whole page babes 🧚 mwah, go measure some TLBs, you absolute icon β­πŸŒˆπŸ’–