From: Hui Su <sh_def@163.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mingo@redhat.com, tim.c.chen@linux.intel.com,
yu.c.chen@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, arighi@nvidia.com,
tj@kernel.org, void@manifault.com, changwoo@igalia.com,
linux-kernel@vger.kernel.org, sched-ext@lists.linux.dev
Subject: Re: [PATCH v4 3/5] sched/cache: Drive cache task tick from execution context
Date: Thu, 10 Sep 2026 19:53:00 +0900 [thread overview]
Message-ID: <20260910105300.2781275-1-sh_def@163.com> (raw)
In-Reply-To: <20260909110348.GZ4120091@noisy.programming.kicks-ass.net>
On Wed, Sep 09, 2026 at 01:03:48PM +0200, Peter Zijlstra wrote:
> The result at this point in the series is:
>
> ~ static void task_tick_fair(struct rq *rq, int queued)
> {
> ~ struct task_struct *curr = rq->curr, *donor = rq->donor;
>
> ~ if (donor->sched_class == &fair_sched_class) {
> ~ struct sched_entity *se = &donor->se;
>
> ~ if (se->on_rq) {
> ~ unsigned long weight = NICE_0_LOAD;
> ~ struct cfs_rq *cfs_rq;
>
> + 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);
> + }
> }
>
> if (queued)
> return;
>
> + /* Update state owned by the execution context. */
> + if (curr->sched_class == &fair_sched_class) {
> ~ if (static_branch_unlikely(&sched_numa_balancing))
> ~ task_tick_numa(rq, curr);
>
> ~ task_tick_cache(rq, curr);
> + }
>
> + /* Update state owned by the scheduling context. */
> + if (donor->sched_class == &fair_sched_class) {
> ~ update_misfit_status(donor, rq);
> ~ check_update_overutilized_status(task_rq(donor));
>
> ~ task_tick_core(rq, donor);
> + }
> }
>
>
> And that is rather weird given how task_tick() works. Please order
> things in a single donor_class and a single curr_class block. A second
> donor_class block makes no sense.
Agreed. I reordered task_tick_fair() so the final form has a single
scheduling-context block followed by a single execution-context block.
Patch 2 moves NUMA handling into the execution block, and patch 3 moves
cache handling into that same block. Misfit, overutilized, and core
scheduling work remain in the donor block.
The resulting layout is:
if (donor->sched_class == &fair_sched_class) {
entity_tick();
reweight_eevdf();
misfit/overutilized/core(donor);
}
if (queued)
return;
if (curr->sched_class == &fair_sched_class) {
task_tick_numa(rq, curr);
task_tick_cache(rq, curr);
}
This excerpt shows that there is no second donor block.
Could you take a look at whether this layout addresses your concern? If so,
I will carry it into v5 and post the updated series.
Thanks,
Hui
next prev parent reply other threads:[~2026-09-10 10:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 9:28 [PATCH v4 0/5] sched: Handle split scheduling and execution contexts in task ticks Hui Su
2026-09-09 9:28 ` [PATCH v4 1/5] sched: Dispatch task ticks for donor and execution classes Hui Su
2026-09-09 10:42 ` Hui Su
2026-09-09 17:43 ` Andrea Righi
2026-09-10 10:49 ` Hui Su
2026-09-09 9:28 ` [PATCH v4 2/5] sched/numa: Drive NUMA task tick from execution context Hui Su
2026-09-09 9:28 ` [PATCH v4 3/5] sched/cache: Drive cache " Hui Su
2026-09-09 11:03 ` Peter Zijlstra
2026-09-10 10:53 ` Hui Su [this message]
2026-09-09 9:29 ` [PATCH v4 4/5] sched/rt: Fix RT watchdog accounting for proxy execution Hui Su
2026-09-09 11:04 ` Peter Zijlstra
2026-09-10 10:54 ` Hui Su
2026-09-12 17:30 ` Hui Su
2026-09-09 9:29 ` [PATCH v4 5/5] sched/core: Fix donor slice accounting under " Hui Su
2026-09-10 10:55 ` Hui Su
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=20260910105300.2781275-1-sh_def@163.com \
--to=sh_def@163.com \
--cc=arighi@nvidia.com \
--cc=bsegall@google.com \
--cc=changwoo@igalia.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=sched-ext@lists.linux.dev \
--cc=tim.c.chen@linux.intel.com \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=void@manifault.com \
--cc=vschneid@redhat.com \
--cc=yu.c.chen@intel.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®