mirror of
https://github.com/torvalds/linux.git
synced 2026-10-23 15:32:04 +02:00
sched/debug: Add migration stats due to non preferred CPUs
Add a new per-task stat, - nr_migrations_cpu_non_preferred: number of push migrations while the CPU is non-preferred. Since this new stat is per-task, it changes only /proc/<pid>/sched. It doesn't update /proc/schedstat. Hence increasing the schedstat version is not necessary. Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20260928053728.797539-10-sshegde@linux.ibm.com
This commit is contained in:
parent
74699f56eb
commit
68957caaa9
|
|
@ -554,6 +554,7 @@ struct sched_statistics {
|
|||
u64 nr_failed_migrations_running;
|
||||
u64 nr_failed_migrations_hot;
|
||||
u64 nr_forced_migrations;
|
||||
u64 nr_migrations_cpu_non_preferred;
|
||||
|
||||
u64 nr_wakeups;
|
||||
u64 nr_wakeups_sync;
|
||||
|
|
|
|||
|
|
@ -11288,8 +11288,13 @@ static int sched_non_preferred_cpu_push_stop(void *arg)
|
|||
update_rq_clock(rq);
|
||||
context_unsafe_alias(rq);
|
||||
|
||||
if (task_rq(p) == rq && task_on_rq_queued(p))
|
||||
rq = __migrate_task(rq, &rf, p, cpu);
|
||||
if (task_rq(p) == rq && task_on_rq_queued(p)) {
|
||||
struct rq *dest_rq = __migrate_task(rq, &rf, p, cpu);
|
||||
|
||||
if (rq != dest_rq)
|
||||
schedstat_inc(p->stats.nr_migrations_cpu_non_preferred);
|
||||
rq = dest_rq;
|
||||
}
|
||||
rq_unlock(rq, &rf);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1440,6 +1440,7 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,
|
|||
P_SCHEDSTAT(nr_failed_migrations_running);
|
||||
P_SCHEDSTAT(nr_failed_migrations_hot);
|
||||
P_SCHEDSTAT(nr_forced_migrations);
|
||||
P_SCHEDSTAT(nr_migrations_cpu_non_preferred);
|
||||
P_SCHEDSTAT(nr_wakeups);
|
||||
P_SCHEDSTAT(nr_wakeups_sync);
|
||||
P_SCHEDSTAT(nr_wakeups_migrate);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user