From: Chen Yu <yu.c.chen@intel.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: <mingo@redhat.com>, <peterz@infradead.org>,
<juri.lelli@redhat.com>, <dietmar.eggemann@arm.com>,
<rostedt@goodmis.org>, <bsegall@google.com>, <mgorman@suse.de>,
<bristot@redhat.com>, <vschneid@redhat.com>,
<linux-kernel@vger.kernel.org>, <parth@linux.ibm.com>,
<qais.yousef@arm.com>, <chris.hyser@oracle.com>,
<patrick.bellasi@matbug.net>, <David.Laight@aculab.com>,
<pjt@google.com>, <pavel@ucw.cz>, <tj@kernel.org>,
<qperret@google.com>, <tim.c.chen@linux.intel.com>,
<joshdon@google.com>, <timj@gnu.org>, <kprateek.nayak@amd.com>,
<youssefesmat@chromium.org>, <joel@joelfernandes.org>
Subject: Re: [PATCH v7 1/9] sched/fair: fix unfairness at wakeup
Date: Sat, 5 Nov 2022 22:32:43 +0800 [thread overview]
Message-ID: <Y2Z0C2whs6pnPLvi@chenyu5-mobl1> (raw)
In-Reply-To: <20221028093403.6673-2-vincent.guittot@linaro.org>
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;
> +}
next prev parent reply other threads:[~2022-11-05 14:33 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-28 9:33 [PATCH v7 0/9] Add latency priority for CFS class Vincent Guittot
2022-10-28 9:33 ` [PATCH v7 1/9] sched/fair: fix unfairness at wakeup Vincent Guittot
2022-11-05 14:32 ` Chen Yu [this message]
2022-11-07 8:00 ` Vincent Guittot
2022-10-28 9:33 ` [PATCH v7 2/9] sched: Introduce latency-nice as a per-task attribute Vincent Guittot
2022-10-28 9:33 ` [PATCH v7 3/9] sched/core: Propagate parent task's latency requirements to the child task Vincent Guittot
2022-10-28 9:33 ` [PATCH v7 4/9] sched: Allow sched_{get,set}attr to change latency_nice of the task Vincent Guittot
2022-10-28 9:33 ` [PATCH v7 5/9] sched/fair: Take into account latency priority at wakeup Vincent Guittot
2022-11-13 8:02 ` shrikanth suresh hegde
2022-11-13 8:39 ` shrikanth suresh hegde
2022-11-14 10:36 ` Vincent Guittot
2022-10-28 9:34 ` [PATCH v7 6/9] sched/fair: Add sched group latency support Vincent Guittot
2022-11-01 19:28 ` Qais Yousef
2022-11-03 8:46 ` Vincent Guittot
2022-11-03 14:27 ` Qais Yousef
2022-11-03 17:02 ` Vincent Guittot
2022-11-04 10:14 ` Joel Fernandes
2022-11-04 10:37 ` Vincent Guittot
2022-11-04 10:48 ` Joel Fernandes
2022-11-04 10:57 ` Vincent Guittot
2022-11-04 10:55 ` Joel Fernandes
2022-11-04 12:06 ` Qais Yousef
2022-11-04 11:47 ` Qais Yousef
2022-11-04 11:21 ` Qais Yousef
2022-11-04 13:13 ` Joel Fernandes
2022-11-05 14:28 ` Qais Yousef
2022-11-04 14:24 ` Vincent Guittot
2022-11-04 14:57 ` Joel Fernandes
2022-11-04 15:03 ` Vincent Guittot
2022-11-04 15:12 ` Joel Fernandes
2022-11-04 15:23 ` Vincent Guittot
2022-11-05 13:41 ` Qais Yousef
2022-10-28 9:34 ` [PATCH v7 7/9] sched/core: Support latency priority with sched core Vincent Guittot
2022-10-28 9:34 ` [PATCH v7 8/9] sched/fair: Add latency list Vincent Guittot
2022-10-28 9:34 ` [PATCH v7 9/9] sched/fair: remove check_preempt_from_others Vincent Guittot
2022-11-13 7:56 ` [PATCH v7 0/9] Add latency priority for CFS class shrikanth suresh hegde
2022-11-13 8:34 ` shrikanth suresh hegde
2022-11-14 10:40 ` Vincent Guittot
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=Y2Z0C2whs6pnPLvi@chenyu5-mobl1 \
--to=yu.c.chen@intel.com \
--cc=David.Laight@aculab.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=chris.hyser@oracle.com \
--cc=dietmar.eggemann@arm.com \
--cc=joel@joelfernandes.org \
--cc=joshdon@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=parth@linux.ibm.com \
--cc=patrick.bellasi@matbug.net \
--cc=pavel@ucw.cz \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=qais.yousef@arm.com \
--cc=qperret@google.com \
--cc=rostedt@goodmis.org \
--cc=tim.c.chen@linux.intel.com \
--cc=timj@gnu.org \
--cc=tj@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
--cc=youssefesmat@chromium.org \
/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