From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751392AbdGQMty (ORCPT ); Mon, 17 Jul 2017 08:49:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49038 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751290AbdGQMtw (ORCPT ); Mon, 17 Jul 2017 08:49:52 -0400 Date: Mon, 17 Jul 2017 14:49:47 +0200 From: Greg KH To: Todd Kjos Cc: devel@driverdev.osuosl.org, arve@android.com, maco@google.com, linux-kernel@vger.kernel.org, tkjos@google.com Subject: Re: [PATCH 00/37] fine-grained locking in binder driver Message-ID: <20170717124947.GA19102@kroah.com> References: <20170629190211.16927-1-tkjos@google.com> <20170630060421.GA2741@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170630060421.GA2741@kroah.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 30, 2017 at 08:04:21AM +0200, Greg KH wrote: > On Thu, Jun 29, 2017 at 12:01:34PM -0700, Todd Kjos wrote: > > The binder driver uses a global mutex to serialize access to state in a > > multi-threaded environment. This global lock has been increasingly > > problematic as Android devices have scaled to more cores. The problem is > > not so much contention for the global lock which still remains relatively > > low, but the priority inversion which occurs regularly when a lower > > priority thread is preempted while holding the lock and a higher priority > > thread becomes blocked on it. These cases can be especially painful if the > > lower priority thread runs in the background on a slow core at a low > > frequency. This often manifests as missed frames or other glitches. > > > > For several years, a hacky solution has been used in many Android devices > > which disables preemption for most of the time the global mutex is held. > > This dramatically decreased the cases of glitches induced by priority > > inversion and increased the average throughput for binder transactions. > > > > Moving to fine-grained locking in this patchset results is a cleaner > > and more scalable solution than the preempt disable hack. Priority > > inversion is decreased significantly. > > Yeah, it is great to see this work done! I'll review these on Monday, > sorry, am traveling at the moment... All now queued up in my trees. thanks, greg k-h