CACHE(8)

πŸ’– CACHE(8) πŸ’–

okay bestie, welcome to the LMBENCH corner of the man pages πŸŽ€ this one is cache, and she is trying her best to figure out what your memory hierarchy is actually doing. spoiler: it's messy in here. 🫢


✨ NAME ✨

cache β€” cache parameters πŸ¦‹


🌸 SYNOPSIS 🌸

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

πŸ’… DESCRIPTION πŸ’…

so like, cache is out here trying to determine the characteristics of the memory hierarchy. yes ma'am. she's attempting to determine:

  • the number of caches πŸ”’
  • the size of each cache πŸ“
  • the line size for each cache βœ‚οΈ
  • and the available memory parallelism at each level in the memory hierarchy 🏊

and the largest amount of memory she will examine is len bytes. that's the ceiling, bestie, we do not go past it. 🚫

here's the gameplay loop, and honestly it's giving detective energy πŸ”: cache first attempts to determine the number and size of caches by measuring the memory latency for various memory sizes. once it has identified the various caches, it then measures the latency, parallelism, and line size for each cache. slay, methodical queen. πŸ‘‘

but β€” and I need you to sit down for this β€” determining the cache size merely from latency is exceedingly difficult 😭 because of variations in cache replacement and prefetching strategies. like, the hardware is doing little secret things and we're just out here timing stuff. it's giving chaos. πŸŒͺ️

and yeah, you can hand her -L <line size>, -M <len>, -W <warmups>, and -N <repetitions> if you wanna. ✨


πŸ’€ BUGS πŸ’€

bestie. listen. this is important.

cache is an experimental benchmark and is known to fail on many processors. πŸ™ˆ

in particular, there are a large number of machines with weird caching behavior that confuse cache and prevent it from accurately determining the number and size of the various caches. so if the numbers come out looking unhinged, it's not you, it's the silicon. πŸ’€


🫢 SEE ALSO 🫢

the whole friend group!! go say hi!! 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Carl Staelin and Larry McVoy πŸŽ€

Comments, suggestions, and bug reports are always welcome. fr fr, they want to hear from you. πŸ’Œ


and that's the whole page, bestie!! πŸ’œ this one comes to you (c)2000 Carl Staelin and Larry McVoy, with a $Date$ stamped on it like a little time capsule, and it lives under CACHE(8) in LMBENCH. go measure something. periodt. βœ¨πŸ’…πŸ¦‹