Revert "sched/fair: Fix value reported by hot tasks pulled in /proc/schedstat"

This reverts commit a18682ccd2 which is
commit a430d99e349026d53e2557b7b22bd2ebd61fe12a upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: Ia71eb1867950bae93b6c426a596d584716137b29
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-03-06 06:07:31 +00:00
parent d4e5cb0cd9
commit 0b3a7df78d
2 changed files with 4 additions and 14 deletions

View File

@@ -900,7 +900,6 @@ struct task_struct {
unsigned sched_reset_on_fork:1;
unsigned sched_contributes_to_load:1;
unsigned sched_migrated:1;
unsigned sched_task_hot:1;
/* Force alignment to the next boundary: */
unsigned :0;

View File

@@ -8425,8 +8425,6 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
int can_migrate = 1;
lockdep_assert_rq_held(env->src_rq);
if (p->sched_task_hot)
p->sched_task_hot = 0;
trace_android_rvh_can_migrate_task(p, env->dst_cpu, &can_migrate);
if (!can_migrate)
@@ -8503,8 +8501,10 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
if (tsk_cache_hot <= 0 ||
env->sd->nr_balance_failed > env->sd->cache_nice_tries) {
if (tsk_cache_hot == 1)
p->sched_task_hot = 1;
if (tsk_cache_hot == 1) {
schedstat_inc(env->sd->lb_hot_gained[env->idle]);
schedstat_inc(p->stats.nr_forced_migrations);
}
return 1;
}
@@ -8531,12 +8531,6 @@ static void detach_task(struct task_struct *p, struct lb_env *env)
if (detached)
return;
if (p->sched_task_hot) {
p->sched_task_hot = 0;
schedstat_inc(env->sd->lb_hot_gained[env->idle]);
schedstat_inc(p->stats.nr_forced_migrations);
}
deactivate_task(env->src_rq, p, DEQUEUE_NOCLOCK);
set_task_cpu(p, env->dst_cpu);
}
@@ -8697,9 +8691,6 @@ static int detach_tasks(struct lb_env *env)
continue;
next:
if (p->sched_task_hot)
schedstat_inc(p->stats.nr_failed_migrations_hot);
list_move(&p->se.group_node, tasks);
}