scx_rusty: Pull domain status check

Check whether the BalanceState of pull_dom.load inside function
try_find_move_task is actually the variant NeedsPull. It'll perform task
migration in abit more conservative manner when the system is under high
loading situation.

Experiments are performed when the system is compiling linux kernel and
undergoing a large amount of I/O operation at the same time using fio.

The result showns that before the modification, there're 12,6617 times
of task migrations system wide. After the modification, there're 11,5419
times of task migrations system wide.

Signed-off-by: I Hsin Cheng <richard120310@gmail.com>
This commit is contained in:
I Hsin Cheng 2024-06-23 21:25:13 +08:00
parent 5038f54701
commit 84b9ac4dce

View File

@ -869,6 +869,10 @@ impl<'a, 'b> LoadBalancer<'a, 'b> {
while pull_node.domains.len() > 0 {
let mut pull_dom = pull_node.domains.remove_index(0);
if pull_dom.load.state() != BalanceState::NeedsPull {
pull_node.domains.insert(pull_dom);
break;
}
let transferred = self.try_find_move_task((&mut push_dom, push_imbal),
(&mut pull_dom, pull_imbal),
xfer)?;