[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2Z0C2whs6pnPLvi@chenyu5-mobl1>
Date: Sat, 5 Nov 2022 22:32:43 +0800
From: Chen Yu <yu.c.chen@...el.com>
To: Vincent Guittot <vincent.guittot@...aro.org>
CC: <mingo@...hat.com>, <peterz@...radead.org>,
<juri.lelli@...hat.com>, <dietmar.eggemann@....com>,
<rostedt@...dmis.org>, <bsegall@...gle.com>, <mgorman@...e.de>,
<bristot@...hat.com>, <vschneid@...hat.com>,
<linux-kernel@...r.kernel.org>, <parth@...ux.ibm.com>,
<qais.yousef@....com>, <chris.hyser@...cle.com>,
<patrick.bellasi@...bug.net>, <David.Laight@...lab.com>,
<pjt@...gle.com>, <pavel@....cz>, <tj@...nel.org>,
<qperret@...gle.com>, <tim.c.chen@...ux.intel.com>,
<joshdon@...gle.com>, <timj@....org>, <kprateek.nayak@....com>,
<youssefesmat@...omium.org>, <joel@...lfernandes.org>
Subject: Re: [PATCH v7 1/9] sched/fair: fix unfairness at wakeup
On 2022-10-28 at 11:33:55 +0200, Vincent Guittot wrote:
[snip]
> +static inline unsigned long get_latency_max(void)
> +{
> + unsigned long thresh = get_sched_latency(false);
> +
> + thresh -= sysctl_sched_min_granularity;
> +
May I know why we substract sysctl_sched_min_granularity above?
I thought thresh -= 1 would be enough to let the waking task preempt
the current one, because:
When a long sleeping task is enqueued on this rq, its vruntime is set
to cfs_rq->min_vtime - latency, so
diff = curr->vtime - cfs_rq->min_vtime + latency,
since (curr->vtime - cfs_rq->min_vtime) >= 0, if we set the thresh to
(latency - 1), the diff is guaranteed to be bigger than thresh and
the waking task can preempt current task.
thanks,
Chenyu
> + return thresh;
> +}
Powered by blists - more mailing lists