Commit 8219143b authored by Guan Jing's avatar Guan Jing Committed by Xia Fukun
Browse files

sched: Add statistics for qos smt expeller

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8O3MY


CVE: NA

--------------------------------

We have added two statistics for qos smt expeller:
a) nr_qos_smt_send_ipi:the times of ipi which
online task expel offline tasks;
b) nr_qos_smt_expelled:the statistics that offline
task will not be picked times.

Signed-off-by: default avatarGuan Jing <guanjing6@huawei.com>
Signed-off-by: default avatarXia Fukun <xiafukun@huawei.com>
parent ceea34dd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -548,6 +548,11 @@ struct sched_statistics {
	u64				nr_wakeups_preferred_cpus;
	u64				nr_wakeups_force_preferred_cpus;
#endif

#ifdef CONFIG_QOS_SCHED_SMT_EXPELLER
	u64				nr_qos_smt_send_ipi;
	u64				nr_qos_smt_expelled;
#endif
#endif /* CONFIG_SCHEDSTATS */
} ____cacheline_aligned;

+5 −0
Original line number Diff line number Diff line
@@ -1046,6 +1046,11 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,
		}
#endif

#ifdef CONFIG_QOS_SCHED_SMT_EXPELLER
		P_SCHEDSTAT(nr_qos_smt_send_ipi);
		P_SCHEDSTAT(nr_qos_smt_expelled);
#endif

		avg_atom = p->se.sum_exec_runtime;
		if (nr_switches)
			avg_atom = div64_ul(avg_atom, nr_switches);
+2 −0
Original line number Diff line number Diff line
@@ -8971,6 +8971,7 @@ static void qos_smt_send_ipi(int this_cpu)
		    rq->cfs.h_nr_running == 0)
			continue;

		schedstat_inc(current->stats.nr_qos_smt_send_ipi);
		smp_send_reschedule(cpu);
	}
}
@@ -9075,6 +9076,7 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf
#ifdef CONFIG_QOS_SCHED_SMT_EXPELLER
	if (qos_smt_expelled(this_cpu)) {
		__this_cpu_write(qos_smt_status, QOS_LEVEL_OFFLINE);
		schedstat_inc(rq->curr->stats.nr_qos_smt_expelled);
		return NULL;
	}
#endif