提交 42f42fee 编写于 作者: G Guan Jing 提交者: Zheng Zengkai

sched: Add statistics for qos smt expeller

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I52611
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: NGuan Jing <guanjing6@huawei.com>
Reviewed-by: NChen Hui <judy.chenhui@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 fd5207be
...@@ -461,8 +461,13 @@ struct sched_statistics { ...@@ -461,8 +461,13 @@ struct sched_statistics {
u64 nr_wakeups_passive; u64 nr_wakeups_passive;
u64 nr_wakeups_idle; u64 nr_wakeups_idle;
#if defined(CONFIG_QOS_SCHED_SMT_EXPELLER) && !defined(__GENKSYMS__)
u64 nr_qos_smt_send_ipi;
u64 nr_qos_smt_expelled;
#else
KABI_RESERVE(1) KABI_RESERVE(1)
KABI_RESERVE(2) KABI_RESERVE(2)
#endif
KABI_RESERVE(3) KABI_RESERVE(3)
KABI_RESERVE(4) KABI_RESERVE(4)
#endif #endif
...@@ -2172,5 +2177,4 @@ static inline int sched_qos_cpu_overload(void) ...@@ -2172,5 +2177,4 @@ static inline int sched_qos_cpu_overload(void)
return 0; return 0;
} }
#endif #endif
#endif #endif
...@@ -982,6 +982,10 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, ...@@ -982,6 +982,10 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,
P_SCHEDSTAT(se.statistics.nr_wakeups_affine_attempts); P_SCHEDSTAT(se.statistics.nr_wakeups_affine_attempts);
P_SCHEDSTAT(se.statistics.nr_wakeups_passive); P_SCHEDSTAT(se.statistics.nr_wakeups_passive);
P_SCHEDSTAT(se.statistics.nr_wakeups_idle); P_SCHEDSTAT(se.statistics.nr_wakeups_idle);
#ifdef CONFIG_QOS_SCHED_SMT_EXPELLER
P_SCHEDSTAT(se.statistics.nr_qos_smt_send_ipi);
P_SCHEDSTAT(se.statistics.nr_qos_smt_expelled);
#endif
avg_atom = p->se.sum_exec_runtime; avg_atom = p->se.sum_exec_runtime;
if (nr_switches) if (nr_switches)
......
...@@ -7455,6 +7455,7 @@ static void qos_smt_send_ipi(int this_cpu) ...@@ -7455,6 +7455,7 @@ static void qos_smt_send_ipi(int this_cpu)
rq->cfs.h_nr_running == 0) rq->cfs.h_nr_running == 0)
continue; continue;
schedstat_inc(current->se.statistics.nr_qos_smt_send_ipi);
smp_send_reschedule(cpu); smp_send_reschedule(cpu);
} }
} }
...@@ -7526,6 +7527,7 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf ...@@ -7526,6 +7527,7 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf
#ifdef CONFIG_QOS_SCHED_SMT_EXPELLER #ifdef CONFIG_QOS_SCHED_SMT_EXPELLER
if (qos_smt_expelled(this_cpu)) { if (qos_smt_expelled(this_cpu)) {
__this_cpu_write(qos_smt_status, QOS_LEVEL_OFFLINE); __this_cpu_write(qos_smt_status, QOS_LEVEL_OFFLINE);
schedstat_inc(rq->curr->se.statistics.nr_qos_smt_expelled);
return NULL; return NULL;
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册