From: "Chen, Yu C" <yu.c.chen@intel.com>
To: Peter Zijlstra <peterz@infradead.org>, Hui Su <sh_def@163.com>
Cc: <mingo@redhat.com>, <tim.c.chen@linux.intel.com>,
<kprateek.nayak@amd.com>, <juri.lelli@redhat.com>,
<vincent.guittot@linaro.org>, <dietmar.eggemann@arm.com>,
<rostedt@goodmis.org>, <bsegall@google.com>, <mgorman@suse.de>,
<vschneid@redhat.com>, <connoro@google.com>, <jstultz@google.com>,
<linux-kernel@vger.kernel.org>, <arighi@nvidia.com>
Subject: Re: [PATCH v3 1/2] sched/numa: Drive NUMA task tick from execution context
Date: Tue, 8 Sep 2026 18:02:26 +0800 [thread overview]
Message-ID: <a89a2aef-f374-4fd6-aafe-ca21d21c980d@intel.com> (raw)
In-Reply-To: <20260908083545.GM4121339@noisy.programming.kicks-ass.net>
On 9/8/2026 4:35 PM, Peter Zijlstra wrote:
> What about something like so?
>
Thanks Peter for taking a look at this. I think this version achieves
better decoupling
since the logic is added per scheduling class, rather than inserting
random hooks into
the core scheduler.
> -static void task_tick_scx(struct rq *rq, struct task_struct *curr, int queued)
> +static void task_tick_scx(struct rq *rq, int queued)
> {
> + struct task_struct *curr = rq->donor;
struct task_struct *donor = rq->donor
> struct scx_sched *sch = scx_task_sched(curr);
>
> + if (donor->sched_class != &ext_sched_class)
> + return;
> +
> update_curr_scx(rq);
>
> /*
[ ... ]
> -static void task_tick_fair(struct rq *rq, struct task_struct *curr, int queued)
> +static void task_tick_fair(struct rq *rq, int queued)
> {
> - struct sched_entity *se = &curr->se;
> + struct task_struct *curr = rq->curr, *donor = rq->donor;
>
> - if (se->on_rq) {
> - unsigned long weight = NICE_0_LOAD;
> - struct cfs_rq *cfs_rq;
> + if (donor->sched_class == &fair_sched_class) {
> + struct sched_entity *se = &donor->se;
>
> - for_each_sched_entity(se) {
> - cfs_rq = cfs_rq_of(se);
> - entity_tick(cfs_rq, se, queued);
> + if (se->on_rq) {
> + unsigned long weight = NICE_0_LOAD;
> + struct cfs_rq *cfs_rq;
>
> - weight = __calc_prop_weight(cfs_rq, se, weight);
> + for_each_sched_entity(se) {
> + cfs_rq = cfs_rq_of(se);
> + entity_tick(cfs_rq, se, queued);
> +
> + weight = __calc_prop_weight(cfs_rq, se, weight);
> + }
> +
> + se = &donor->se;
> + reweight_eevdf(cfs_rq, se, weight, se->on_rq);
> }
>
> - se = &curr->se;
> - reweight_eevdf(cfs_rq, se, weight, se->on_rq);
> + if (queued)
> + return;
> +
> + update_misfit_status(donor, rq);
> + check_update_overutilized_status(task_rq(donor));
> +
> + task_tick_core(rq, donor);
> }
>
> - if (queued)
> - return;
The queued check might still be needed: if donor is not a fair task, we
still
want to skip the numa balancing/sched_cache for hrtick event?
thanks,
Chenyu
next prev parent reply other threads:[~2026-09-08 10:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 8:52 [PATCH v3 0/2] sched: Fix execution-context tick handling under proxy execution Hui Su
2026-09-04 8:52 ` [PATCH v3 1/2] sched/numa: Drive NUMA task tick from execution context Hui Su
2026-09-04 15:52 ` Chen Yu
2026-09-04 17:17 ` Tim Chen
2026-09-08 7:40 ` Chen, Yu C
2026-09-08 8:35 ` Peter Zijlstra
2026-09-08 10:02 ` Chen, Yu C [this message]
2026-09-08 10:44 ` Peter Zijlstra
2026-09-08 12:10 ` Hui Su
2026-09-09 8:37 ` Peter Zijlstra
2026-09-04 8:52 ` [PATCH v3 2/2] sched/cache: Drive cache " Hui Su
2026-09-08 7:45 ` Chen, Yu C
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=a89a2aef-f374-4fd6-aafe-ca21d21c980d@intel.com \
--to=yu.c.chen@intel.com \
--cc=arighi@nvidia.com \
--cc=bsegall@google.com \
--cc=connoro@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=jstultz@google.com \
--cc=juri.lelli@redhat.com \
--cc=kprateek.nayak@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=sh_def@163.com \
--cc=tim.c.chen@linux.intel.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.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®