Live data from Hacker News

Why Intel Added Cache Partitioning

danluu.com

41–50 of 56 posts

Re: Why Intel Added Cache Partitioning

#41
post #27
post #24

Earlier quoted context omitted.

Yeah. Nothing ground-breaking here. Would still love to have a great open-source tool for this.

You mean like oprofile, dtrace, system tap, cachegrind, etc.?

Ah, I see where you may have got confused.

I meant regarding the automatic application of rules based on profiling.

Re: Why Intel Added Cache Partitioning

#42
I find it really weird that the article says:

> It’s curious that we have low cache hit rates, a lot of time stalled on cache/memory, and low bandwidth utilization.

That's typical for most workloads! Software is almost never compute or bandwidth bound in my experience, but instead spends most of its time waiting on memory in pointer chasing code. This is especially true for code written in managed languages like Java (since everything typically is boxed and allocated all over the heap).

Re: Why Intel Added Cache Partitioning

#43
post #36
post #33

Earlier quoted context omitted.

A lot of those optimizations would no longer yield any benefits[0]. The CPU archictecture evolved a lot in 16 years, especially in branch/code prediction to the point where a correctly predicted branch (without branch_likely) has almost no cost. [0]: At least, this is true for x86 CPUs.

I've occasionally wondered how long it takes highly optimized C/C++ to be surpassed by optimizing compilers due to CPU advancement and the optimizations either making compiler optimization harder, or the optimizations target assumptions about CPU architecture that are no longer valid. That is, what is the shelf life of a very low level CPU optimization for Intel hardware.

Well while strictly not on topic, there was this talk recently on micro-optimisations.

https://www.youtube.com/watch?v=nXaxk27zwlk

Re: Why Intel Added Cache Partitioning

#44
post #41
post #27

Earlier quoted context omitted.

You mean like oprofile, dtrace, system tap, cachegrind, etc.?

Ah, I see where you may have got confused. I meant regarding the automatic application of rules based on profiling.

What are you looking for that is not currently part of the profile guided optimization capabilities of current compilers? It has been the case for years that you can compile a program with profiling/tracing hooks, run it through a representative workload, and feed the profiler output back to the compiler to get a faster executable. That's why no Firefox you compile yourself will outperform the one you download from Mozilla, if you only compile it a single time.

Re: Why Intel Added Cache Partitioning

#45

I find it really weird that the article says: > It’s curious that we have low cache hit rates, a lot of time stalled on cache/memory, and low bandwidth utilization. That's typical for most workloads! Software is almost never compute or bandwidth bound in my experience, but instead spends most of its time waiting on memory in pointer chasing code. This is especially true for code written in managed languages like Java…

It's curious that there's low bandwidth utilization despite the low but rates / cpu stalled waiting for memory. Don't you think?

Perhaps random access of small data causes frequent waits without utilizing the bandwidth in a way that block copies would.

Re: Why Intel Added Cache Partitioning

#46
post #6

The SPECint and SPECfp benchmark suites were never very tightly connected to real-world performance, but I wonder what these figures look like for SPECjbb, the java benchmark. (If I recall correctly, SPECjbb spins up an app that looks a lot like "java pet store" and runs clients against it.)

[deleted]

Re: Why Intel Added Cache Partitioning

#47

To me putting high-priority low-latency process and a low-priority high-throughput process on the same machine is a recipe for disaster - they will find some way to get entangled and hurt each other. Kudos to google for pulling this out but the article shows that you need expertise on all levels of the stack to attempt this. Most of us are better off with simply buying more boxes :)

Or we can automate this in an OS/cluster manager and safely this with everyone like we do with some many other technologies that are difficult for most of us to develop :)

One can dream... Of course having this available as an opensource technology would be great but for now it is a piece of proprietary tech inside google.

Re: Why Intel Added Cache Partitioning

#48
post #33

Earlier quoted context omitted.

A lot of those optimizations would no longer yield any benefits[0]. The CPU archictecture evolved a lot in 16 years, especially in branch/code prediction to the point where a correctly predicted branch (without branch_likely) has almost no cost. [0]: At least, this is true for x86 CPUs.

Ditto for prefetch instructions: https://lwn.net/Articles/444336/ A MIPS is probably the exact opposite to modern (which actually means anything P6 and above) x86 CPUs in terms of performance characteristics. If I were to guess what member of the x86 family might actually benefit from such optimisation, it would be NetBurst (which itself has very different performance characteristics from every other x86 family that…

I was trying to optimize for a network app. The goal of trying to get to 1 million pps. At that time 200Mz CPU, 1 cache miss is 50+ cycles. or 25% of the CPU budget, prefetch helped a lot in that case.

Re: Why Intel Added Cache Partitioning

#49
post #33

Earlier quoted context omitted.

A lot of those optimizations would no longer yield any benefits[0]. The CPU archictecture evolved a lot in 16 years, especially in branch/code prediction to the point where a correctly predicted branch (without branch_likely) has almost no cost. [0]: At least, this is true for x86 CPUs.

As a CPU architect, I can confirm that all those except possibly 2) will not yield significant benefits. Prefetching hints will only be useful when the particular code fragment is highly memory-bound because most wide superscalar microarchitectures will easily hide L1/L2 miss latencies.

If a DDR stall is 50+ cpu cycles, (probably a lot more with today's 2, 3GHz CPU), I am not sure if superscalar microarchitectures would help too much.

At lease in my case of networking packet forwarding app, I had the profiling data to prove that was an issue.

The app code is not that long ~2000 lines of code after clean up. But it have a lot of table looks up (DDR stall) and branches for error condition checks.

Re: Why Intel Added Cache Partitioning

#50
post #44
post #41

Earlier quoted context omitted.

Ah, I see where you may have got confused. I meant regarding the automatic application of rules based on profiling.

What are you looking for that is not currently part of the profile guided optimization capabilities of current compilers? It has been the case for years that you can compile a program with profiling/tracing hooks, run it through a representative workload, and feed the profiler output back to the compiler to get a faster executable. That's why no Firefox you compile yourself will outperform the one you download from M…

In my experience, none change the source-code themselves.
Post reply on HN