From: Tejun Heo <tj@kernel.org>
To: Changwoo Min <changwoo@igalia.com>
Cc: void@manifault.com, arighi@nvidia.com, kernel-dev@igalia.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 03/11] sched_ext: Add an event, SELECT_CPU_FALLBACK
Date: Mon, 27 Jan 2025 10:01:40 -1000 [thread overview]
Message-ID: <Z5fmJHcuKG4hfDbJ@slm.duckdns.org> (raw)
In-Reply-To: <20250126101614.232388-4-changwoo@igalia.com>
Hello,
On Sun, Jan 26, 2025 at 07:16:06PM +0900, Changwoo Min wrote:
...
> struct scx_event_stats {
> + /*
> + * If ops.select_cpu() returns a CPU which can't be used by the task,
> + * the core scheduler code silently picks a fallback CPU.
> + */
> + u64 SELECT_CPU_FALLBACK;
As C has one global namespace, we're gonna have to prefix these. Hopefully,
something not too long. SCX_EV_?
> @@ -3663,6 +3668,10 @@ static int select_task_rq_scx(struct task_struct *p, int prev_cpu, int wake_flag
> cpu = SCX_CALL_OP_TASK_RET(SCX_KF_ENQUEUE | SCX_KF_SELECT_CPU,
> select_cpu, p, prev_cpu, wake_flags);
> *ddsp_taskp = NULL;
> +
> + if (unlikely(!is_cpu_allowed(p, cpu)))
> + __scx_add_event(SELECT_CPU_FALLBACK, 1);
This is trying to guess what select_task_rq() is going to do and then count
that as an event, which doesn't seem great. Can't we just record the picked
CPU here into a field in p->scx and then compare that against cpu_of(rq) in
enqueue_task_scx()? That way, we can reliably count events where CPU
selection was modified by the fallback logic regardless of why or how that
happens.
Thanks.
--
tejun
next prev parent reply other threads:[~2025-01-27 20:01 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 [this message]
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 ` [PATCH v2 08/11] sched_ext: Add an event, BYPASS_DISPATCH Changwoo Min
2025-01-27 20:05 ` 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=Z5fmJHcuKG4hfDbJ@slm.duckdns.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=kernel-dev@igalia.com \
--cc=linux-kernel@vger.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®