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


Groups > linux.kernel > #1480668

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-10 18:30 +0200
Message-ID <sfTkf-2xR-55@gated-at.bofh.it> (permalink)
References <sfadr-84F-7@gated-at.bofh.it> <sfTay-2uE-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Sep 10, 2016 at 09:16:59AM -0700, Christoph Hellwig wrote:
> On Thu, Sep 08, 2016 at 09:12:50AM -0700, Todd Kjos wrote:
> > In Android systems, the display pipeline relies on low
> > latency binder transactions and is therefore sensitive to
> > delays caused by contention for the global binder lock.
> > Jank is siginificantly reduced by disabling preemption
> > while the global binder lock is held.
> 
> That's now how preempt_disable is supposed to use.  It is for critical

not, that's supposed to be _not_. Just to be absolutely clear, this is
NOT how you're supposed to use preempt_disable().

> sections that use per-cpu or similar resources.
> 
> > 
> > Originally-from: Riley Andrews <riandrews@google.com>
> > Signed-off-by: Todd Kjos <tkjos@google.com>

> > @@ -389,7 +390,11 @@ static int task_get_unused_fd_flags(struct
> > binder_proc *proc, int flags)
> >   rlim_cur = task_rlimit(proc->tsk, RLIMIT_NOFILE);
> >   unlock_task_sighand(proc->tsk, &irqs);
> > 
> > - return __alloc_fd(files, 0, rlim_cur, flags);
> > + preempt_enable_no_resched();
> > + ret = __alloc_fd(files, 0, rlim_cur, flags);
> > + preempt_disable();

And the fact that people want to use preempt_enable_no_resched() shows
that they're absolutely clueless.

This is so broken its not funny.

NAK NAK NAK

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