一篇介紹Linux負載均衡的文章:
Linux Load Balancing Mechanism
CSDN資源地址
// 尋找sched domain中最忙的group // 函數參數: // sd:待查找的sched domain // this_cpu:當前正在對其執行負載均衡的cpu // imbalance:爲達到平衡需要移動的權重 //
// 計算group在給定domain中的imbalance // 調用路徑:find_busiest_group->calculate_imbalance // 函數參數: // sds:sched domain的統計信息 // t
// 負載均衡 // 在sched_domain中進行負載均衡,檢查是否可以通過最繁忙的組中遷移一些進程到本cpu // 函數參數: // this_cpu, 其上執行負載均衡的cpu // this_rq, 其上執行負載均衡的rq
// 參考:http://blog.csdn.net/dog250/article/details/5303561 // 負載均衡 // 當rq->next_balance到時,觸發負載均衡 // 調用路徑:scheduler_ti