Bryan O'Sullivan wrote:
On Thu, Mar 19, 2009 at 10:52 PM, Manuel M T Chakravarty <c...@cse.unsw.edu.au <mailto:c...@cse.unsw.edu.au>> wrote:
    The comment above setThreadAffinity() says,

        // Schedules the thread to run on CPU n of m.  m may be less
        than the
        // number of physical CPUs, in which case, the thread will be
        allowed
        // to run on CPU n, n+m, n+2m etc.


    I am not convinced that this is a good plan.  If m is less than n,
    some threads can hop between CPUs and so invalidate their L2 cache
    repeatedly.


Even worse, on a NUMA system, you can end up pinning a thread to a CPU that is physically distant from its memory, which imposes a substantial performance penalty (even on Opteron systems). I'd be very very wary of setting thread affinity by hand.

That's why it's optional.

Simon

_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to