From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Josh Don <joshdon@google.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
linux-kernel <linux-kernel@vger.kernel.org>,
Paul Turner <pjt@google.com>
Subject: Re: [PATCH v2] sched/fair: Do not set skip buddy up the sched hierarchy
Date: Wed, 18 Dec 2019 12:36:42 +0100 [thread overview]
Message-ID: <55c162e4-2f3a-5628-cbe3-31bce6cb8480@arm.com> (raw)
In-Reply-To: <CABk29Ns3v3KqAo89oEOqQjRQxWN4Wgc+YtweWbS13MtmsUJeyw@mail.gmail.com>
On 12/12/2019 23:19, Josh Don wrote:
> On Mon, Dec 9, 2019 at 1:19 AM Dietmar Eggemann
> <dietmar.eggemann@arm.com> wrote:
>>
>> On 06.12.19 23:13, Josh Don wrote:
>>
>> [...]
>>
>>> On Thu, Dec 5, 2019 at 11:57 PM Vincent Guittot
>>> <vincent.guittot@linaro.org> wrote:
>>>>
>>>> Hi Josh,
>>>>
>>>> On Wed, 4 Dec 2019 at 21:06, Josh Don <joshdon@google.com> wrote:
>>>>>
>>>>> From: Venkatesh Pallipadi <venki@google.com>
>>>>>
>>>>> Setting skip buddy all the way up the hierarchy does not play well
>>>>> with intra-cgroup yield. One typical usecase of yield is when a
>>>>> thread in a cgroup wants to yield CPU to another thread within the
>>>>> same cgroup. For such a case, setting the skip buddy all the way up
>>
>> But with yield_task{_fair}() you have no way to control which other task
>> gets accelerated. The other task in the taskgroup (cgroup) could be even
>> on another CPU.
>>
>> It's not like yield_to_task_fair() which uses next buddy to accelerate
>> another task p.
>>
>> What's this typical usecase?
>
> The semantics for yield_task under CFS are not well-defined. With our
> CFS hierarchy, we cannot easily just push a yielded task to the end of
> a runqueue. And, we don't want to play games with artificially
> increasing vruntime, as this results in potentially high latency for a
> yielded task to get back on CPU.
>
> I'd interpret a task that calls yield as saying "I can run, but try to
> run something else." I'd agree that this patch is imperfect in
> achieving this, but I think it is better than the current
> implementation (or at least, less broken). Currently, a side-effect
> of calling yield is that all other tasks in the same hierarchy get
> skipped as well. This is almost certainly not what the user
> expects/wants. It is true that if a yielded task has no other tasks
> in its cgroup on the same CPU, we will potentially end up just picking
> the yielded task again. But this should be OK; a yielded task should
> be able to continue making forward progress. Any yielded task that
> calls yield again is likely implementing a busy loop, which is an
> improper use of yield anyway.
I see the issue you want to address.
But isn't then the comment in the patch "... a thread in a cgroup wants
to yield CPU to another thread within the same cgroup ..." misleading?
IMHO, a task can't yield to another task. It can only relinquish the CPU.
Someone could argue that in the current implementation, the task which
calls yield acts on behalf of all the tasks in its taskgroup hierarchy.
But this can have issues as you pointed out.
[...]
next prev parent reply other threads:[~2019-12-18 11:36 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-04 20:06 Josh Don
2019-12-06 7:57 ` Vincent Guittot
2019-12-06 22:13 ` Josh Don
2019-12-09 9:18 ` Dietmar Eggemann
2019-12-12 22:19 ` Josh Don
2019-12-18 11:36 ` Dietmar Eggemann [this message]
2019-12-18 20:02 ` Josh Don
2019-12-19 0:14 ` [PATCH v3] " Josh Don
2019-12-26 15:05 ` Vincent Guittot
2020-02-25 1:50 ` Josh Don
2019-12-12 8:05 ` [PATCH v2] " Vincent Guittot
2019-12-17 19:58 ` Josh Don
2019-12-17 20:42 ` Peter Zijlstra
2019-12-17 21:00 ` Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2019-11-04 14:54 [PATCH] " Vincent Guittot
2019-11-06 22:14 ` [PATCH v2] " Josh Don
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=55c162e4-2f3a-5628-cbe3-31bce6cb8480@arm.com \
--to=dietmar.eggemann@arm.com \
--cc=bsegall@google.com \
--cc=joshdon@google.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.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
all inboxes | Powered by JetHome®