Re: [PATCH v2 2/2] sched/cache: Drive cache task tick from execution context
From: Hui Su
Date: Fri Sep 04 2026 - 00:04:41 EST
On Thu, Sep 3, 2026 at 10:23 AM, Tim Chen wrote:
> May be worth adding a comment here. Say you consolidate the
> exec context stuff to a new sched_tick_exec_ctx() helper.
> You can say something like the following here to help future
> reader of this code.
>
> + /*
> + * Note: misfit, overutilized and core scheduling state describe the
> + * entity the load balancer would move, i.e. the scheduling context,
> + * and therefore stay with @curr rather than with rq->curr. See
> + * sched_tick_exec_ctx() for the execution context counterpart.
> + */
> I think task_tick_core() needs to stay with the donor's context
> as it is the scheduling context.
>
> There is a separate issue lurking here, task_tick_core() measures
> consumed slice as se->sum_exec_runtime - se->prev_sum_exec_runtime.
> Under proxy the donor's sum_exec_runtime does not advance, so that
> delta stays near zero and the force-idle resched may never trigger.
> Passing rq->curr does not fix it either. This is somewhat orthogonal
> to the issue that the execution context series is trying to solve.
> It should be fixed separately.
Hi Tim,
Thanks. I'll consolidate the NUMA/cache execution-context handling into
a sched_tick_exec_ctx() helper and use it from both sched_tick() and
sched_tick_remote().
I'll also add a comment in task_tick_fair() explaining that misfit,
overutilized and core-scheduling state remain associated with the
scheduling context.
I'll fold these changes into v3.
Thanks,
Hui