From: Changwoo Min <changwoo@igalia.com>
To: tj@kernel.org, void@manifault.com, arighi@nvidia.com
Cc: kernel-dev@igalia.com, linux-kernel@vger.kernel.org,
Changwoo Min <changwoo@igalia.com>
Subject: [PATCH v2 08/11] sched_ext: Add an event, BYPASS_DISPATCH
Date: Sun, 26 Jan 2025 19:16:11 +0900 [thread overview]
Message-ID: <20250126101614.232388-9-changwoo@igalia.com> (raw)
In-Reply-To: <20250126101614.232388-1-changwoo@igalia.com>
Add a core event, BYPASS_DISPATCH, which represents how many tasks
have been dispatched in the bypass mode.
__scx_add_event() is used since the caller holds an rq lock,
so the preemption has already been disabled.
Signed-off-by: Changwoo Min <changwoo@igalia.com>
---
kernel/sched/ext.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index bb363809e484..9a680774c1fc 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -1486,6 +1486,11 @@ struct scx_event_stats {
*/
u64 ENQ_SKIP_EXITING;
+ /*
+ * The number of tasks dispatched in the bypassing mode.
+ */
+ u64 BYPASS_DISPATCH;
+
/*
* The number of times the bypassing mode has been activated.
*/
@@ -2941,6 +2946,8 @@ static int balance_one(struct rq *rq, struct task_struct *prev)
return false;
has_tasks:
+ if (scx_rq_bypassing(rq))
+ __scx_add_event(BYPASS_DISPATCH, 1);
rq->scx.flags &= ~SCX_RQ_IN_BALANCE;
return true;
}
@@ -5524,6 +5531,7 @@ static void scx_dump_state(struct scx_exit_info *ei, size_t dump_len)
scx_dump_event(s, &events, DISPATCH_LOCAL_DSQ_OFFLINE);
scx_dump_event(s, &events, DISPATCH_KEEP_LAST);
scx_dump_event(s, &events, ENQ_SKIP_EXITING);
+ scx_dump_event(s, &events, BYPASS_DISPATCH);
scx_dump_event(s, &events, BYPASS_ACTIVATE);
if (seq_buf_has_overflowed(&s) && dump_len >= sizeof(trunc_marker))
@@ -7856,6 +7864,7 @@ __bpf_kfunc void scx_bpf_event_stats(struct scx_event_stats *events,
scx_agg_event(&e_sys, e_cpu, SELECT_CPU_FALLBACK);
scx_agg_event(&e_sys, e_cpu, DISPATCH_LOCAL_DSQ_OFFLINE);
scx_agg_event(&e_sys, e_cpu, DISPATCH_KEEP_LAST);
+ scx_agg_event(&e_sys, e_cpu, BYPASS_DISPATCH);
scx_agg_event(&e_sys, e_cpu, BYPASS_ACTIVATE);
}
--
2.48.1
next prev parent reply other threads:[~2025-01-26 10:16 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-26 10:16 [PATCH v2 00/11] sched_ext: Implement core event counters Changwoo Min
2025-01-26 10:16 ` [PATCH v2 01/11] sched_ext: Implement event counter infrastructure Changwoo Min
2025-01-27 20:09 ` Tejun Heo
2025-01-30 6:12 ` Changwoo Min
2025-01-26 10:16 ` [PATCH v2 02/11] sched: Move is_cpu_allowed() to the header Changwoo Min
2025-01-26 10:16 ` [PATCH v2 03/11] sched_ext: Add an event, SELECT_CPU_FALLBACK Changwoo Min
2025-01-27 20:01 ` Tejun Heo
2025-01-30 6:22 ` Changwoo Min
2025-01-26 10:16 ` [PATCH v2 04/11] sched_ext: Add an event, DISPATCH_LOCAL_DSQ_OFFLINE Changwoo Min
2025-01-26 10:16 ` [PATCH v2 05/11] sched_ext: Add an event, DISPATCH_KEEP_LAST Changwoo Min
2025-01-26 10:16 ` [PATCH v2 06/11] sched_ext: Add an event, ENQ_SKIP_EXITING Changwoo Min
2025-01-26 10:16 ` [PATCH v2 07/11] sched_ext: Add an event, BYPASS_ACTIVATE Changwoo Min
2025-01-27 20:03 ` Tejun Heo
2025-01-30 6:34 ` Changwoo Min
2025-01-26 10:16 ` Changwoo Min [this message]
2025-01-27 20:05 ` [PATCH v2 08/11] sched_ext: Add an event, BYPASS_DISPATCH Tejun Heo
2025-01-30 6:26 ` Changwoo Min
2025-01-30 12:25 ` Tejun Heo
2025-01-31 1:13 ` Changwoo Min
2025-01-26 10:16 ` [PATCH v2 09/11] sched_ext: Add an event, BYPASS_DURATION Changwoo Min
2025-01-26 10:16 ` [PATCH v2 10/11] sched_ext: Add scx_bpf_event_stats() and scx_read_event() for BPF schedulers Changwoo Min
2025-01-26 10:16 ` [PATCH v2 11/11] sched_ext: Print core event count in scx_central scheduler Changwoo Min
2025-01-27 20:08 ` Tejun Heo
2025-01-30 6:28 ` Changwoo Min
2025-01-27 20:10 ` [PATCH v2 00/11] sched_ext: Implement core event counters Tejun Heo
2025-01-30 6:28 ` Changwoo Min
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250126101614.232388-9-changwoo@igalia.com \
--to=changwoo@igalia.com \
--cc=arighi@nvidia.com \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=void@manifault.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®