|
|
|
|
|
by rossjudson
4557 days ago
|
|
It's not that you would want to. It's that certain data structures (particularly in kernel land) naturally form around powers-of-2 sizing. Since the hashing in an n-way associative cache is done by masking away bits, you can get into this nasty situation where multiple elements of your data structure end up hashing to the same location set (the N in an N-way associative cache). You don't want that if you are going to walk the elements in your structure. Either avoid walking the elements, or do whatever it takes to ensure that you don't end up getting stuck behind the N. Hardware is inescapable. It's also worth noting that you can use this to your advantage, ensuring that accesses to certain elements does not push much else out of the associative cache. |
|