Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1482969

Re: [PATCH] android: binder: Disable preemption while holding the global binder lock

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] android: binder: Disable preemption while holding the global binder lock
Date 2016-09-14 09:20 +0200
Message-ID <shcEa-6cS-7@gated-at.bofh.it> (permalink)
References (3 earlier) <sfTDz-2EA-3@gated-at.bofh.it> <sfUgh-36t-7@gated-at.bofh.it> <sgMTn-4wA-5@gated-at.bofh.it> <sgQtX-7bp-3@gated-at.bofh.it> <sh226-6k1-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Christoph Hellwig <hch@infradead.org> - 2016-09-10 18:20 +0200
  Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Peter Zijlstra <peterz@infradead.org> - 2016-09-10 18:30 +0200
    Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Thomas Gleixner <tglx@linutronix.de> - 2016-09-10 18:50 +0200
      Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-10 19:30 +0200
        Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Todd Kjos <tkjos@android.com> - 2016-09-12 18:00 +0200
        Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Arve Hjønnevåg <arve@android.com> - 2016-09-13 05:50 +0200
          Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-09-13 08:50 +0200
            Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Arve Hjønnevåg <arve@android.com> - 2016-09-13 22:00 +0200
          Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Peter Zijlstra <peterz@infradead.org> - 2016-09-13 09:40 +0200
            Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Arve Hjønnevåg <arve@android.com> - 2016-09-13 22:00 +0200
              Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Peter Zijlstra <peterz@infradead.org> - 2016-09-14 09:20 +0200
                Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Peter Zijlstra <peterz@infradead.org> - 2016-09-14 09:50 +0200
                Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Peter Zijlstra <peterz@infradead.org> - 2016-09-14 15:40 +0200
              Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Peter Zijlstra <peterz@infradead.org> - 2016-09-14 18:20 +0200
                Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Peter Zijlstra <peterz@infradead.org> - 2016-09-14 18:20 +0200
                Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Peter Zijlstra <peterz@infradead.org> - 2016-09-14 19:00 +0200
                Re: [PATCH] android: binder: Disable preemption while holding the  global binder lock Todd Kjos <tkjos@android.com> - 2016-09-17 02:50 +0200

csiph-web