From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751109AbcGMU1L (ORCPT ); Wed, 13 Jul 2016 16:27:11 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:45454 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751142AbcGMU1A (ORCPT ); Wed, 13 Jul 2016 16:27:00 -0400 Date: Wed, 13 Jul 2016 22:26:57 +0200 From: Peter Zijlstra To: Tejun Heo Cc: John Stultz , Ingo Molnar , lkml , Dmitry Shmidt , Rom Lemarchand , Colin Cross , Todd Kjos , Oleg Nesterov , "Paul E. McKenney" Subject: Re: Severe performance regression w/ 4.4+ on Android due to cgroup locking changes Message-ID: <20160713202657.GW30154@twins.programming.kicks-ass.net> References: <20160713182102.GJ4065@mtj.duckdns.org> <20160713183347.GK4065@mtj.duckdns.org> <20160713201823.GB29670@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160713201823.GB29670@mtj.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 Wed, Jul 13, 2016 at 04:18:23PM -0400, Tejun Heo wrote: > Hello, John. > > On Wed, Jul 13, 2016 at 01:13:11PM -0700, John Stultz wrote: > > On Wed, Jul 13, 2016 at 11:33 AM, Tejun Heo wrote: > > > On Wed, Jul 13, 2016 at 02:21:02PM -0400, Tejun Heo wrote: > > >> One interesting thing to try would be replacing it with a regular > > >> non-percpu rwsem and see how it behaves. That should easily tell us > > >> whether this is from actual contention or artifacts from percpu_rwsem > > >> implementation. > > > > > > So, something like the following. Can you please see whether this > > > makes any difference? > > > > Yea. So this brings it down for me closer to what we're seeing with > > the Dmitry's patch reverting the two problematic commits, usually > > 10-50us with one early spike at 18ms. > > So, it's a percpu rwsem issue then. I haven't really followed the > perpcpu rwsem changes closely. Oleg, are multi-milisec delay expected > on down write expected with the current implementation of > percpu_rwsem? There is a synchronize_sched() in there, so sorta. That thing is heavily geared towards readers, as is the only 'sane' choice for global locks.