[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250116151543.80163-5-changwoo@igalia.com>
Date: Fri, 17 Jan 2025 00:15:40 +0900
From: Changwoo Min <changwoo@...lia.com>
To: tj@...nel.org,
void@...ifault.com,
arighi@...dia.com
Cc: kernel-dev@...lia.com,
linux-kernel@...r.kernel.org,
Changwoo Min <changwoo@...lia.com>
Subject: [PATCH 4/7] sched_ext: Add an event, SCX_EVENT_ENQ_LOCAL_EXITING
Add a core event, SCX_EVENT_ENQ_LOCAL_EXITING, which represents how many
times a task is enqueued to a local DSQ when exiting if SCX_OPS_ENQ_EXITING
is not set.
Signed-off-by: Changwoo Min <changwoo@...lia.com>
---
kernel/sched/ext.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 909f12a41934..094e19f5fb78 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -1479,6 +1479,12 @@ struct scx_event_stat {
* continued to run because there were no other tasks on the CPU.
*/
u64 CNTD_RUN_WO_ENQ;
+
+ /*
+ * If SCX_OPS_ENQ_EXITING is not set, the number of times that a task
+ * is dispatched to a local DSQ when exiting.
+ */
+ u64 ENQ_LOCAL_EXITING;
};
#define SCX_EVENT_IDX(e) (offsetof(struct scx_event_stat, e)/sizeof(u64))
@@ -1493,6 +1499,7 @@ enum scx_event_kind {
SCX_EVENT_DEFINE(INVAL_SELECT_CPU),
SCX_EVENT_DEFINE(OFFLINE_LOCAL_DSQ),
SCX_EVENT_DEFINE(CNTD_RUN_WO_ENQ),
+ SCX_EVENT_DEFINE(ENQ_LOCAL_EXITING),
SCX_EVENT_END = SCX_EVENT_END_IDX(),
};
@@ -1500,6 +1507,7 @@ static const char *scx_event_stat_str[] = {
[SCX_EVENT_INVAL_SELECT_CPU] = "invalid_select_cpu",
[SCX_EVENT_OFFLINE_LOCAL_DSQ] = "offline_local_dsq",
[SCX_EVENT_CNTD_RUN_WO_ENQ] = "cntd_run_wo_enq",
+ [SCX_EVENT_ENQ_LOCAL_EXITING] = "enq_local_exiting",
};
/*
@@ -2087,8 +2095,10 @@ static void do_enqueue_task(struct rq *rq, struct task_struct *p, u64 enq_flags,
/* see %SCX_OPS_ENQ_EXITING */
if (!static_branch_unlikely(&scx_ops_enq_exiting) &&
- unlikely(p->flags & PF_EXITING))
+ unlikely(p->flags & PF_EXITING)) {
+ scx_add_event(ENQ_LOCAL_EXITING, 1);
goto local;
+ }
if (!SCX_HAS_OP(enqueue))
goto global;
--
2.48.1
Powered by blists - more mailing lists