From: Tejun Heo <tj@kernel.org>
To: void@manifault.com, arighi@nvidia.com, multics69@gmail.com
Cc: linux-kernel@vger.kernel.org, sched-ext@meta.com,
Tejun Heo <tj@kernel.org>
Subject: [PATCH 3/3] sched_ext: Add SCX_EV_ENQ_SKIP_MIGRATION_DISABLED
Date: Fri, 7 Feb 2025 22:42:17 -1000 [thread overview]
Message-ID: <20250208084229.1274399-4-tj@kernel.org> (raw)
In-Reply-To: <20250208084229.1274399-1-tj@kernel.org>
Count the number of times a migration disabled task is automatically
dispatched to its local DSQ.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/sched/ext.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 310db8484b77..b2378e29f45a 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -1483,6 +1483,13 @@ struct scx_event_stats {
*/
u64 SCX_EV_ENQ_SKIP_EXITING;
+ /*
+ * If SCX_OPS_ENQ_MIGRATION_DISABLED is not set, the number of times a
+ * migration disabled task skips ops.enqueue() and is dispatched to its
+ * local DSQ.
+ */
+ u64 SCX_EV_ENQ_SKIP_MIGRATION_DISABLED;
+
/*
* The total number of tasks enqueued (or pick_task-ed) with a
* default time slice (SCX_SLICE_DFL).
@@ -2119,8 +2126,10 @@ static void do_enqueue_task(struct rq *rq, struct task_struct *p, u64 enq_flags,
/* see %SCX_OPS_ENQ_MIGRATION_DISABLED */
if (!static_branch_unlikely(&scx_ops_enq_migration_disabled) &&
- is_migration_disabled(p))
+ is_migration_disabled(p)) {
+ __scx_add_event(SCX_EV_ENQ_SKIP_MIGRATION_DISABLED, 1);
goto local;
+ }
if (!SCX_HAS_OP(enqueue))
goto global;
@@ -5067,6 +5076,7 @@ static void scx_dump_state(struct scx_exit_info *ei, size_t dump_len)
scx_dump_event(s, &events, SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE);
scx_dump_event(s, &events, SCX_EV_DISPATCH_KEEP_LAST);
scx_dump_event(s, &events, SCX_EV_ENQ_SKIP_EXITING);
+ scx_dump_event(s, &events, SCX_EV_ENQ_SKIP_MIGRATION_DISABLED);
scx_dump_event(s, &events, SCX_EV_ENQ_SLICE_DFL);
scx_dump_event(s, &events, SCX_EV_BYPASS_DURATION);
scx_dump_event(s, &events, SCX_EV_BYPASS_DISPATCH);
@@ -7210,6 +7220,7 @@ __bpf_kfunc void scx_bpf_events(struct scx_event_stats *events,
scx_agg_event(&e_sys, e_cpu, SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE);
scx_agg_event(&e_sys, e_cpu, SCX_EV_DISPATCH_KEEP_LAST);
scx_agg_event(&e_sys, e_cpu, SCX_EV_ENQ_SKIP_EXITING);
+ scx_agg_event(&e_sys, e_cpu, SCX_EV_ENQ_SKIP_MIGRATION_DISABLED);
scx_agg_event(&e_sys, e_cpu, SCX_EV_ENQ_SLICE_DFL);
scx_agg_event(&e_sys, e_cpu, SCX_EV_BYPASS_DURATION);
scx_agg_event(&e_sys, e_cpu, SCX_EV_BYPASS_DISPATCH);
--
2.48.1
next prev parent reply other threads:[~2025-02-08 8:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-08 8:42 [PATCHSET sched_ext/for-6.15] sched_ext: Event counter updates Tejun Heo
2025-02-08 8:42 ` [PATCH 1/3] tool/sched_ext: Event counter dumping updates Tejun Heo
2025-02-08 8:42 ` [PATCH 2/3] sched_ext: Count SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE in the right spot Tejun Heo
2025-02-08 8:42 ` Tejun Heo [this message]
2025-02-08 9:12 ` [PATCHSET sched_ext/for-6.15] sched_ext: Event counter updates Changwoo Min
2025-02-09 6:40 ` Tejun Heo
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=20250208084229.1274399-4-tj@kernel.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=multics69@gmail.com \
--cc=sched-ext@meta.com \
--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®