News for hackers. Stuff that matters.
Re:Why do CPUs have multiple cache levels? by daly on Monday August 08, 2016 @02:06AM (#12245747)
Suppose you want to make a salad.

register: a tomato in your hand level 1 cache: a tomato on the counter level 2 cache: a tomato in the refrigerator level 3 cache: a tomato at the store main memory: a tomato on the plant at the farm disk: a tomato seed being planted

Re:Why do CPUs have multiple cache levels? by kondro on Monday August 08, 2016 @08:51AM (#12247301)
Please don't put your tomatoes in the refrigerator. Now you've gone and corrupted them.
Re:Why do CPUs have multiple cache levels? by dpark on Monday August 08, 2016 @11:44AM (#12248636)
This is a myth unless you eat all your tomatoes in a day or two.

http://www.seriouseats.com/2014/09/why-you-should-refrigerat...

Re:Why do CPUs have multiple cache levels? by kondro on Monday August 08, 2016 @01:01PM (#12249200)
I will reserve judgement. This wasn't a particularly great experiment to disapprove one with a lot more scientific rigour.
Re:Why do CPUs have multiple cache levels? by dpark on Monday August 08, 2016 @02:55PM (#12250029)
I'm not aware of any rigorous experiments that demonstrate that tomatoes are better left at room temperature than in a refrigerator. The French study referenced indicates that volatiles are reduced (no surprise) but that the effect is partially negated by allowing them to come back to room temperature before consumption. From what I can tell, this study does not compare quality of tomatoes left at room temperature for days to refrigerated tomatoes.

The article I linked did a more in-depth comparison and still came to the same conclusion. http://www.seriouseats.com/2014/09/tomato-taste-test-refrige...

I don't consider 2 separate testings with 16 subjects to be a poor experiment. Could it be even better? Sure. Is it a lot more rigorous than the anecdotal claims people propagate about refrigerated tomatoes? Absolutely.

Re:Why do CPUs have multiple cache levels? by nabla9 on Monday August 08, 2016 @03:02AM (#12245912)
This analogy is not explaining why.

Why not just make more hands? Why multiple levels?

Re:Why do CPUs have multiple cache levels? by seanmcdirmid on Monday August 08, 2016 @03:21AM (#12245978)
We are limited to two hands. The kitchen can only hold so many tomatoes and other things you need to cook. You could buy all the produce you needed for the year and store it at your house, but it is wasteful (you actually don't need it, storing it is expensive, and it displaces other things you need in your house like your toilet).

In the old days, humans would live near their wild food and not cache much. Then the Neolithic revolution happened, we started caching seeds and then surplus produce in cities, and eventually refrigeration came along and we could cache more. Each new level of caching allowed us to do more (increase population). Ya, we could still live as hunter gatherers, but we would be doing less. We could still be using Eniacs, also, we would just be computing slower.

Re:Why do CPUs have multiple cache levels? by taneq on Monday August 08, 2016 @03:19AM (#12245970)
Hands cost a lot more than benchtop space, which costs a lot more than cupboard space, which costs a lot more than supermarket space.
Re:Why do CPUs have multiple cache levels? by xxs on Monday August 08, 2016 @06:14AM (#12246581)
More hands - Imagine the brain power required to coordinate more than 2 hands. It's already really hard to do two separate tasks. (You may also ask why not slice and dice a couple of tomatoes simultaneously) Add the energy allocated just for the brain and vascular system and you'd understand why having a tomato onto the table is way simpler.
Re:Why do CPUs have multiple cache levels? by posterboy on Monday August 08, 2016 @06:23AM (#12246617)
The right analogy would be bigger hands. Another reason than already mentioned IIRC is the connection on the cpu, it's a problem of geometry: Access speed decreases with physical distance on the core.

The other problems might be neatly visualized with geometric examples as well, but I'm not sure I understand them right. I'm comfortable to assume it's black magic, when fgiesen aka ryg is talking about it.

Re:Why do CPUs have multiple cache levels? by drwl on Monday August 08, 2016 @02:21AM (#12245788)
The post the author wrote goes more in depth than this. Per your analogy, it doesn't quite explain if multiple people (cores) want to make a salad. For example, how does the tomato on the counter and refrigerator get allocated?
Re:Why do CPUs have multiple cache levels? by posterboy on Monday August 08, 2016 @03:50AM (#12246100)
It's probably over the top of many heads, so a simple explanation is probably what they expect from the title.
Re:Why do CPUs have multiple cache levels? by drwl on Monday August 08, 2016 @05:17AM (#12246401)
I'm confused, are you referring to the answer to the thread question or to the article's explanation?
Re:Why do CPUs have multiple cache levels? by posterboy on Monday August 08, 2016 @06:11AM (#12246569)
Obviously the few sentence answer here is much simpler than the (reposted) over my head article discussing cache strategies. If the article contains the answer, it's not up front. It starts with a quote that goes along the lines of "I know why cache is necessary ...", so then I didn't read much further to find out if the explanation will be repeated, because I remember reading the article before. I jumped to the conclusion that the necessity for a cache also explains the necessity for caches of caches.

Edit: I was trying to say, the in depth explanation there and the ad-hoc hint given here both have their place.

On the other hand, maybe not, if one should read the article first, but who does that, right? /s

Re:Why do CPUs have multiple cache levels? by milcron on Monday August 08, 2016 @02:07AM (#12245748)
You need two newline characters for HN to put the text on a new line.