[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99c18623-4533-4dde-a765-ea43c85ee02f@amperemail.onmicrosoft.com>
Date: Mon, 15 Dec 2025 17:35:45 +0800
From: Shijie Huang <shijie@...eremail.onmicrosoft.com>
To: Dietmar Eggemann <dietmar.eggemann@....com>,
Huang Shijie <shijie@...amperecomputing.com>, mingo@...hat.com,
peterz@...radead.org, juri.lelli@...hat.com, vincent.guittot@...aro.org
Cc: patches@...erecomputing.com, cl@...ux.com,
Shubhang@...amperecomputing.com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, linux-kernel@...r.kernel.org, vschneid@...hat.com,
vineethr@...ux.ibm.com, kprateek.nayak@....com
Subject: Re: [PATCH v6 2/2] sched: update the rq->avg_idle when a task is
moved to an idle CPU
On 12/12/2025 22:22, Dietmar Eggemann wrote:
>>> So you could move (1) back to (2) avoiding the 'if rq->idle_stamp' for
>>> the sched_change pattern for instance?
>> Could you please tell me what is "avoiding the 'if rq->idle_stamp' for
>> the sched_change pattern" ?
>>
>> Sorry, I do not understand your meaning.
> sched_change uses dequeue_task()/enqueue_task() for a queued task to
> change prio, policy, sched params, taskgroups, etc.
For sched_change, the dequeue_task()/enqueue_task() only work when
the queued task has TASK_ON_RQ_QUEUED flags. The TASK_ON_RQ_QUEUED
is set in activate_task().
1.) For this active task, if the sched_change makes it
dequeue_task()/enqueue_task() on
current CPU, it's okay. Since current CPU is not in the newidle,
the "rq->idle_stamp" is 0 at this case.
This patch works fine.
2.) For this active task, if the sched_change makes it
dequeue_task()/enqueue_task() on an another CPU,
it's okay too.
2.1) If the another CPU's idle_stamp is 0, the another CPU is
busy now.
The sched_change works fine with this patch.
2.2) If the another CPU's idle_stamp is not 0, the
sched_change also works fine with this patch.
Since the sched_change is breaking the idle state of
the another CPU by moving an active
task to an idle CPU. It makes sense.
Thanks
Huang Shijie
Powered by blists - more mailing lists