From: John H. <ha...@sg...> - 2002-12-13 19:07:17
|
It would appear that the idle thread's "cpus_allowed" field is uninitialized (and defaults to 0xffffffff) for i386 and badly initialized for ia64 (at least for our SGI SN systems), rather than being initialized to pin each idle thread to its specific CPU. The effect of that is that the scheduler's load_balance() algorithm will chose an idle thread to migrate if the "busiest" CPU is busy with processes that are pinned to that CPU and thus cannot move. One solution is to explicitly initialize current->cpus_allowed at the top of cpu_idle(). Can you think of a better way to accomplish this? This means that every arch-specific cpu_idle() must be changed. An alternative is to add an additional check in load_balance() to CAN_MIGRATE_TASK to never migrate the idle task. That's a single global change (vs. one per arch), but adds to the work that load_balance() must do. Another alternative would be to add to migration_thread something like: rq->idle->cpus_allowed = (1UL << cpu); as a global one-shot initialization that doesn't add more work to load_balance(). Comments? John Hawkes |