From: Changwoo Min <changwoo@igalia.com>
To: Tejun Heo <tj@kernel.org>
Cc: void@manifault.com, arighi@nvidia.com, kernel-dev@igalia.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 07/11] sched_ext: Add an event, SCX_EV_BYPASS_DISPATCH
Date: Tue, 4 Feb 2025 00:51:02 +0900 [thread overview]
Message-ID: <e1a028d8-3be2-4bea-961a-855de4626999@igalia.com> (raw)
In-Reply-To: <Z5-sgoiOGTJvB8e5@slm.duckdns.org>
Hello,
On 25. 2. 3. 02:33, Tejun Heo wrote:
> Hello,
>
> On Fri, Jan 31, 2025 at 04:09:34PM +0900, Changwoo Min wrote:
> ...
>> @@ -2869,11 +2874,17 @@ static int balance_one(struct rq *rq, struct task_struct *prev)
>> }
>>
>> /* if there already are tasks to run, nothing to do */
>> - if (rq->scx.local_dsq.nr)
>> + if (rq->scx.local_dsq.nr) {
>> + if (scx_rq_bypassing(rq))
>> + __scx_add_event(SCX_EV_BYPASS_DISPATCH, 1);
>> goto has_tasks;
>> + }
>>
>> - if (consume_global_dsq(rq))
>> + if (consume_global_dsq(rq)) {
>> + if (scx_rq_bypassing(rq))
>> + __scx_add_event(SCX_EV_BYPASS_DISPATCH, 1);
>
> Hmm... Wouldn't it be easier to count it from select_task_rq_scx() and
> do_enqueue_task()? The latter already has scx_rq_bypassing() condition and
> the former one can easily cache bypassing test result and use that in the
> else block.
That makes sense. I will change the code as you suggested.
>
>> @@ -2899,10 +2910,16 @@ static int balance_one(struct rq *rq, struct task_struct *prev)
>> rq->scx.flags |= SCX_RQ_BAL_KEEP;
>> goto has_tasks;
>> }
>> - if (rq->scx.local_dsq.nr)
>> + if (rq->scx.local_dsq.nr) {
>> + if (scx_rq_bypassing(rq))
>> + __scx_add_event(SCX_EV_BYPASS_DISPATCH, 1);
>> goto has_tasks;
>> - if (consume_global_dsq(rq))
>> + }
>> + if (consume_global_dsq(rq)) {
>> + if (scx_rq_bypassing(rq))
>> + __scx_add_event(SCX_EV_BYPASS_DISPATCH, 1);
>> goto has_tasks;
>> + }
>
> The above can happen while bypass mode is being turned on but once on
> control doesn't even reach here, right?
You are right. I will clean this up.
Regards,
Changwoo Min
next prev parent reply other threads:[~2025-02-03 15:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-31 7:09 [PATCH v3 00/11] sched_ext: Implement core event counters Changwoo Min
2025-01-31 7:09 ` [PATCH v3 01/11] sched_ext: Implement event counter infrastructure Changwoo Min
2025-01-31 7:09 ` [PATCH v3 02/11] sched_ext: Add an event, SCX_EV_SELECT_CPU_FALLBACK Changwoo Min
2025-02-02 17:34 ` Tejun Heo
2025-01-31 7:09 ` [PATCH v3 03/11] sched_ext: Add an event, SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE Changwoo Min
2025-01-31 7:09 ` [PATCH v3 04/11] sched_ext: Add an event, SCX_EV_DISPATCH_KEEP_LAST Changwoo Min
2025-02-02 17:24 ` Tejun Heo
2025-01-31 7:09 ` [PATCH v3 05/11] sched_ext: Add an event, SCX_EV_ENQ_SKIP_EXITING Changwoo Min
2025-02-02 17:20 ` Tejun Heo
2025-02-03 15:46 ` Changwoo Min
2025-01-31 7:09 ` [PATCH v3 06/11] sched_ext: Add an event, SCX_EV_BYPASS_ACTIVATE Changwoo Min
2025-01-31 7:09 ` [PATCH v3 07/11] sched_ext: Add an event, SCX_EV_BYPASS_DISPATCH Changwoo Min
2025-02-02 17:33 ` Tejun Heo
2025-02-03 15:51 ` Changwoo Min [this message]
2025-01-31 7:09 ` [PATCH v3 08/11] sched_ext: Add an event, SCX_EV_BYPASS_DURATION Changwoo Min
2025-02-02 17:35 ` Tejun Heo
2025-02-03 15:48 ` Changwoo Min
2025-01-31 7:09 ` [PATCH v3 09/11] sched_ext: Add scx_bpf_events() and scx_read_event() for BPF schedulers Changwoo Min
2025-01-31 7:09 ` [PATCH v3 10/11] sched_ext: Print core event count in scx_central scheduler Changwoo Min
2025-01-31 7:09 ` [PATCH v3 11/11] sched_ext: Print core event count in scx_qmap scheduler Changwoo Min
2025-02-02 17:37 ` [PATCH v3 00/11] sched_ext: Implement core event counters 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=e1a028d8-3be2-4bea-961a-855de4626999@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®