Ingo Molnar wrote: > this was done intentionally, and this scenario (1+2 tasks) is the very > worst scenario. The problem is that by trying to balance all 3 tasks we > now have 3 tasks that trash their cache going from one CPU to another. > (this is what happens with your patch - even with another approach we'd > have to trash at least one task) > > By keeping 2 tasks on one CPU and 1 task on the other CPU we avoid > cross-CPU migration of threads. Think about the 2+3 or 4+5 tasks case > rather, do we want absolutely perfect balancing, or good SMP affinity and > good combined performance? OK... But what about the (imbalance / 2) part? Either the comment needs to change, or the code. Attatched is a slightly revised patch for the code. The comment patch would be even easier: - /* It needs an at least ~25% imbalance to trigger balancing. */ + /* It needs an at least ~50% imbalance to trigger balancing. */ Either way works for me. I'd like to see something done, as the comments don't match the code right now... Cheers! -Matt