Hacker News new | past | comments | ask | show | jobs | submit login
The “Uncanny Valley” of L3 Cache Contention (bad-concurrency.blogspot.com)
86 points by r4um on Dec 3, 2014 | hide | past | favorite | 11 comments



This is great. I've come across a few articles lately about caches and their effects on performance. It's really interesting stuff. If this interested you, then you might find this article[1] by Dan Luu on improving performance by misaligning data interesting as well.

[1]: http://danluu.com/3c-conflict/



Can anyone explain why the relative performance of different # threads spreads out again for working sets > 8 MB?


At that point, the performance of his benchmark depends of DRAM access. In modern system, DRAM is very parallel -- a single access is glacially slow but you can have a lot of accesses in flight. It would appear that a single thread of his benchmark cannot provide enough access parallelism to saturate his DRAM interfaces.


[deleted]


L2 cache isn't shared, at least looking at the die picture.


I'm not sure if it's happening here, but for what it's worth, it's not true that L2 can't be shared. On cores with hyperthreading, it's a shared resource.

You can see the impact of this contention on some data generated on an i5-650 here: http://tmp.capelis.dj/2014/l2c.png


Huh.

Now that I look at it, you can actually see the effects of it on the graph in the article. Look at scalability at 128k and 256k.


Yes, also notice how those dips show up more for even numbers of threads than odd numbers of threads. :)

That system is hyperthreading.


You're right. I forgot what was being measured here.


When the threads are hitting memory anyway, the cache is less hot, so the contention on the cache is actually reduced.


More threads can probably queue up memory requests a bit faster than one thread which is doing some processing between requests.

I can't explain the precise convergence at the 8MiB mark, though.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: