Re: Processor affinity planned for 2.5?

From: Jakob Østergaard (jakob@unthought.net)
Date: Wed Oct 18 2000 - 11:14:20 EST


On Wed, Oct 18, 2000 at 01:13:48PM +0200, Markus Pfeiffer wrote:
> HI all
>
> I received and discussed Processor-affinity on the SMP-Kernel-list and I
> only wanted to ask if there is something in preparation or if someone
> (especially Linus :)) is against this ... I was asked this question
> beacause someone wanted to do some Matrix-Operations on his SMP machine
> and wnated to speed them up by trying affinity ...

I don't know the exact answer to your question, but I can tell you that there
has been patches floating around for a long time (somehwere) to provide
processor affinity for processes in the Linux kernel.

However, the patches has never been merged because:
 *) No matter how self-contained and simple and elegant they may be,
     they complicate the scheduler (maybe not much, but more than not)
 *) There is no performance gain what so ever, expcept for perhaps some
     very specially fabricated benchmark in some very specially fabricated
     test environment. In the best case, you will not get a slowdown from
     the explicit affinity.

Think about it: It's the scheduler's job to distribute the threads of
execution reasonably among the available processors. The scheduler knows the
state of the system and *you* don't when you put in your static affinity
decisions. You are bound to lose.

Yes, I know that big-iron IRIX boxes have explicit processor affinity available
to user-space. They also have gang-scheduling, which is more complicated and
maybe more likely to actually give you a speedup than explicit affinity. IRIX
has a lot of things, and let's not get into *that* one again ;)

If you want to achieve anything in life, keep it simple. Be happy you have a
scheduler that on any day can do a better job than you at scheduling the
threads, and get on with your work :)

Cheers,

-- 
................................................................
:   jakob@unthought.net   : And I see the elder races,         :
:.........................: putrid forms of man                :
:   Jakob Østergaard      : See him rise and claim the earth,  :
:        OZ9ABN           : his downfall is at hand.           :
:.........................:............{Konkhra}...............:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:13 EST