Re: Kernel Development & Objective-C

Andi Kleen
2007-12-03T11:50:25Z

On Mon, Dec 03, 2007 at 01:46:45PM +0200, Avi Kivity wrote:
> If you have 10M packets/sec no amount of cycle-saving will help you.
> You need high level optimizations like TSO. I'm not saying we should
> sacrifice cycles like there's no tomorrow, but the big wins are elsewhere.

Both high and low level optimizations are needed for good performance.

> >Similar with highend routing or in some latency sensitive network
> >applications (e.g. in HPC).
>
> True. And here, the hardware can cut hundreds of cycles by avoiding the
> kernel completely for the fast path.

A lot of applications don't and the user space networking schemes
tend to have their own drawbacks anyways.

> >Another simple noticeable case is Unix
> >sockets and your X server communication.
>
> Your reflexes are *much* better than mine if you can measure half a
> nanosecond on X.

That's not about mouse/keyboard input, but about all X protocol communication
between X clients and X server. The key is not large copies here
anyways (large data is put into shm) but latency.

> And again the key is batching, improving cpu affinity, and caching, not
> looking for a faster instruction sequence.

That's not the whole story no. Batching etc are needed, but the
faster instruction sequences are needed too.

> Nanooptimizations are fun (I do them myself, I admit) but that's not
> where performance as measured by the end user lies.

It depends. Often high level (and then caching) optimizations are better
bang for the buck, but completely disregarding the fast path work is a bad
thing too. As an example see Christoph's recent work on the slub fastpath
which makes a quite measurable difference on benchmarks.

-Andi