From: Peter Zijlstra <peterz@infradead.org>
To: "Arve Hjønnevåg" <arve@android.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
Riley Andrews <riandrews@android.com>,
LKML <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@infradead.org>,
Todd Kjos <tkjos@google.com>
Subject: Re: [PATCH] android: binder: Disable preemption while holding the global binder lock
Date: Wed, 14 Sep 2016 09:10:01 +0200 [thread overview]
Message-ID: <20160914071001.GI5008@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CAMP5Xgc89ZONamzB4gmnH3RjW5rDSwh3Akrx30npfTiZ1qGzWg@mail.gmail.com>
On Tue, Sep 13, 2016 at 12:53:27PM -0700, Arve Hjønnevåg wrote:
> On Tue, Sep 13, 2016 at 12:32 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> > On Mon, Sep 12, 2016 at 08:44:09PM -0700, Arve Hjønnevåg wrote:
> >
> >> A previous attempt to fix this problem, changed the lock to use
> >> rt_mutex instead of mutex, but this apparently did not work as well as
> >> this patch. I believe the added overhead was noticeable, and it did
> >> not work when the preempted thread was in a different cgroup (I don't
> >> know if this is still the case).
> >
> > Do you actually have RR/FIFO/DL tasks? Currently PI isn't
> > defined/implemented for OTHER.
> >
>
> Most of the tasks here are not RR/FIFO/DL tasks. I don't see anything
> in the rtmutex code or documentation that indicates that they don't
> work for normal tasks. From what I can tell the priority gets boosted
> in every case. This may not work as well for CFS tasks as for realtime
> tasks, but it should at least help when there is a large priority
> difference.
It does something (it used to explicitly ignore OTHER) but its not
something well defined or usable.
> > cgroups should be irrelevant, PI is unaware of them.
>
> I don't think cgroups are irrelevant. PI being unaware of them
> explains the problem I described. If the task that holds the lock is
> in a cgroup that has a low cpu.shares value, then boosting the task's
> priority within that group does necessarily make it any more likely to
> run.
See, the problem is that 'priority' is a meaningless concept for
OTHER/CFS.
In any case, typically only RT tasks care about PI, and the traditional
Priority Inheritance algorithm only really works correctly for FIFO. As
is RR has issues and DL is a crude hack, CFS is really just an accident
by not explicitly exempting it.
We could define a meaningful something for CFS and implement that, but
it isn't currently done.
next prev parent reply other threads:[~2016-09-14 7:10 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-08 16:12 [PATCH] android: binder: Disable preemption while holding the global binder lock Todd Kjos
2016-09-08 16:15 ` Todd Kjos
2016-09-08 17:46 ` Greg Kroah-Hartman
2016-09-10 16:16 ` Christoph Hellwig
2016-09-10 16:22 ` Peter Zijlstra
2016-09-10 16:37 ` Thomas Gleixner
2016-09-10 17:28 ` Greg Kroah-Hartman
2016-09-12 15:49 ` Todd Kjos
2016-09-13 3:44 ` Arve Hjønnevåg
2016-09-13 6:42 ` Greg Kroah-Hartman
2016-09-13 19:52 ` Arve Hjønnevåg
2016-09-13 7:32 ` Peter Zijlstra
2016-09-13 19:53 ` Arve Hjønnevåg
2016-09-14 7:10 ` Peter Zijlstra [this message]
2016-09-14 7:41 ` Peter Zijlstra
2016-09-14 13:38 ` Peter Zijlstra
2016-09-14 16:11 ` Peter Zijlstra
2016-09-14 16:13 ` Peter Zijlstra
2016-09-14 16:55 ` Peter Zijlstra
2016-09-17 0:42 ` Todd Kjos
-- strict thread matches above, loose matches on Subject: below --
2016-09-09 15:17 Todd Kjos
2016-09-09 15:44 ` Greg KH
2016-09-09 17:39 ` Todd Kjos
2016-09-10 11:18 ` Greg KH
2016-09-10 11:25 ` Greg KH
2016-09-10 11:25 ` Greg KH
2016-09-09 16:37 ` kbuild test robot
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=20160914071001.GI5008@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=arve@android.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=riandrews@android.com \
--cc=tglx@linutronix.de \
--cc=tkjos@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.