[openbeos] Re: Multi CPU thread scheduling (question)

> Morning / Afternoon / Evening
> 
> This evening I gave Haiku a twirl (mouse only support, no keyboard), 
> and
> tried the famous GLTeapot demo.  I have an AMD Dual Core CPU, and 
> with Pulse
> open noticed a pecularity.  For one second GLTeapot would hammer CPU 
> #1 at
> 100% with the second CPU idle, and after a second or so, the roles 
> would
> swap around (CPU #2 would be 100%, while the first core is idle).

That is not uncommon in R5 either mind you.
It's not really a problem.

> Yes, it's good to see Haiku scheduling a task to the free CPU when 
> the other
> is busy.  What is not good is the bouncing around, especially 
> considering
> that the CPU cache's get flushed / refilled with every transition.   
> The
> question I have is - is there anything that can be done to avoid this
> (schedular design and CPU affinity)?

Yes, cpu affinity could help, but it's not really that bad if it 
switches only every second.
Even without supporting controlling this affinity, the scheduler could 
be made to weight the current CPU so the thread stays on it.
But the current situation is probably fine, and could actually be 
considered a feature. Yes, doing this ensures your CPUs are heated 
evenly, so the first one won't explode while the 2nd one stays cold :D


François.

Other related posts: