Linux2.6的负载均衡算法调度域支持CMP,CMT,SMP,NUMA架构.针对CMT,算法尝试分配新进程到最空闲的处理器核中的最空闲的CPU上;如果某个处理器核中的第一个CPU比较空闲,它会周期性地从该核的最繁忙的CPU上的迁移适量的任务到这个CPU上以平衡系统的任务.然而在某些情况下,该策略会导致系统更加不平衡.有两种方法可以弥补该算法的缺陷:一是新进程放到整个系统的最空闲的CPU上;二是最空闲的CPU可以迁移调度域中的任务.在8处理器核32线程XLR532处理器系统上,使用HackBench测试,系统最高达到8%的性能提升。
Linux 2.6 load balancing algorithm on the scheduling domain supports CMP, CMT, SMP, NUMA architectures. For CMT, the algorithm tries to assign the new process to the idlest CPU of the idlest core, and if the first CPU of a core is comparatively idle, it tries to pull a moderate amount of tasks from the busiest CPU of the core to balance the system workload periodically. Under certain circumstances, this strategy would cause the system to be more unbalanced. For the above defects, the algorithm can be adjusted in two ways. The idlest CPU of the entire system should be selected for the new process, and the idlest CPU of a scheduling domain can periodically move tasks from the scheduling domain to itself. After applying this optimization, the system's performance by as much as 8% in HackBench testing on an 8-core 32 thread XLR532 processor.