Re: Poor performance of pthreads across cpu dies.
Re: Poor performance of pthreads across cpu dies.
- Subject: Re: Poor performance of pthreads across cpu dies.
- From: Michael Smith <email@hidden>
- Date: Sat, 1 Sep 2007 12:39:28 -0700
On Aug 31, 2007, at 10:42 PM, Terry Lambert wrote:
I'd actually like to see an outside researcher demonstrate
benchmarks vs. this approach. Mac OS X doesn't run in virtual wire
mode for interrupt delivery, so interrupts are always fielded by the
same processor.
This is not necessarily the case.
On some PPC platforms, interrupts are always handled by a single CPU.
On the remainder, and on x86, there are several interrupt distribution
schemes in play. The x86 algorithm is (as I recall) roughly to prefer
CPUs that are awake, and of those prefer the CPU with the lowest APIC
ID that is not currently servicing an interrupt.
As Drew points out, not a lot happens in interrupt context - the real
work is left to the scheduler invoking the workloop thread - but the
scheduler isn't terribly well off either. In the specific case of
network data input, the scheduler would need to know which userland
thread is currently blocked on (or will shortly read from) the socket
to which the data that the network adatper has just received will be
delivered. Never mind that no code has yet looked at this data, nor
that there may be data for several sockets/threads to be delivered.
Once it has worked this out, it needs to know which cache domain
currently contains the working set for these thread(s), and assess the
relative cost of moving them such that it can pick a domain in which
to run the workloop thread as well as any network-stack internal
threads or callouts. Sadly, Apple has not yet worked out a good
interface between the scheduler and commonly-available crystal balls,
and so this remains a difficult thing to do.
= Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden