Commit c37fce7
committed
sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat
JIRA: https://issues.redhat.com/browse/RHEL-24185
commit a430d99
Author: Peter Zijlstra <peterz@infradead.org>
Date: Fri Dec 20 06:32:19 2024 +0000
sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat
In /proc/schedstat, lb_hot_gained reports the number hot tasks pulled
during load balance. This value is incremented in can_migrate_task()
if the task is migratable and hot. After incrementing the value,
load balancer can still decide not to migrate this task leading to wrong
accounting. Fix this by incrementing stats when hot tasks are detached.
This issue only exists in detach_tasks() where we can decide to not
migrate hot task even if it is migratable. However, in detach_one_task(),
we migrate it unconditionally.
[Swapnil: Handled the case where nr_failed_migrations_hot was not accounted properly and wrote commit log]
Fixes: d319808 ("sched: Move up affinity check to mitigate useless redoing overhead")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reported-by: "Gautham R. Shenoy" <gautham.shenoy@amd.com>
Not-yet-signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20241220063224.17767-2-swapnil.sapkal@amd.com
Signed-off-by: Phil Auld <pauld@redhat.com>1 parent 91caaa2 commit c37fce7
2 files changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
| 947 | + | |
947 | 948 | | |
948 | 949 | | |
949 | 950 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9414 | 9414 | | |
9415 | 9415 | | |
9416 | 9416 | | |
| 9417 | + | |
| 9418 | + | |
9417 | 9419 | | |
9418 | 9420 | | |
9419 | 9421 | | |
| |||
9486 | 9488 | | |
9487 | 9489 | | |
9488 | 9490 | | |
9489 | | - | |
9490 | | - | |
9491 | | - | |
9492 | | - | |
| 9491 | + | |
| 9492 | + | |
9493 | 9493 | | |
9494 | 9494 | | |
9495 | 9495 | | |
| |||
9504 | 9504 | | |
9505 | 9505 | | |
9506 | 9506 | | |
| 9507 | + | |
| 9508 | + | |
| 9509 | + | |
| 9510 | + | |
| 9511 | + | |
| 9512 | + | |
9507 | 9513 | | |
9508 | 9514 | | |
9509 | 9515 | | |
| |||
9664 | 9670 | | |
9665 | 9671 | | |
9666 | 9672 | | |
| 9673 | + | |
| 9674 | + | |
| 9675 | + | |
9667 | 9676 | | |
9668 | 9677 | | |
9669 | 9678 | | |
| |||
0 commit comments