From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751296AbcGNMLI (ORCPT ); Thu, 14 Jul 2016 08:11:08 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46038 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751044AbcGNMLE (ORCPT ); Thu, 14 Jul 2016 08:11:04 -0400 Date: Thu, 14 Jul 2016 14:11:01 +0200 From: Peter Zijlstra To: Tejun Heo Cc: "Paul E. McKenney" , John Stultz , Ingo Molnar , lkml , Dmitry Shmidt , Rom Lemarchand , Colin Cross , Todd Kjos , Oleg Nesterov Subject: Re: Severe performance regression w/ 4.4+ on Android due to cgroup locking changes Message-ID: <20160714121101.GA30154@twins.programming.kicks-ass.net> References: <20160713201823.GB29670@mtj.duckdns.org> <20160713202657.GW30154@twins.programming.kicks-ass.net> <20160713203944.GC29670@mtj.duckdns.org> <20160713205102.GZ30909@twins.programming.kicks-ass.net> <20160713210315.GO7094@linux.vnet.ibm.com> <20160713210526.GF29670@mtj.duckdns.org> <20160713211841.GQ7094@linux.vnet.ibm.com> <20160713220128.GA15005@htj.duckdns.org> <20160714064956.GC30909@twins.programming.kicks-ass.net> <20160714112046.GB15005@htj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160714112046.GB15005@htj.duckdns.org> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 14, 2016 at 07:20:46AM -0400, Tejun Heo wrote: > On Thu, Jul 14, 2016 at 08:49:56AM +0200, Peter Zijlstra wrote: > > So the immediate problem with lg style locks is that the 'local' lock > > will not stay local since these are preemptible locks we can get > > migrations etc.. > > > > All fixable, but still. > > In this case, the locks are read-locked only across operations which > change process hierarchy. They'll occasionally get migrated while > holding the lock for sure but not often enough to matter. Means having to change the interface to pass along what 'local' is, like srcu_read_lock(). > > So the main objection I have is that this isn't a fundamental fix, this > > only cures things because Android only runs on small machines. > > > > If someone with a big computer tries to do the same things we're up some > > creek without no paddle. There's just no way we can make a global writer > > 'fast'. > > How so? As the number of cores increases, it'll get proportionally > more expensive as the same operation is performed on more CPUs; > however, the latency is dependent on the slowest one and it'll get > higher more often with more number of CPUs but not drastically. A global lock on 4 or 8 socket machines with all 200+ cpus trying to use it really stinks. Remember, they switch cgroups at really rather high rates here, because of that binder stuff. I don't see how you can defend a global lock here :/ Global locks only work when writers are extremely rare, and clearly that premise is false. Also note that since these are preemptible locks, you can get unbounded priority inversions.