From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751350AbcGMVBf (ORCPT ); Wed, 13 Jul 2016 17:01:35 -0400 Received: from mail-yw0-f171.google.com ([209.85.161.171]:34124 "EHLO mail-yw0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751276AbcGMVB0 (ORCPT ); Wed, 13 Jul 2016 17:01:26 -0400 Date: Wed, 13 Jul 2016 17:01:14 -0400 From: Tejun Heo To: Peter Zijlstra 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: <20160713210114.GE29670@mtj.duckdns.org> References: <20160713182102.GJ4065@mtj.duckdns.org> <20160713183347.GK4065@mtj.duckdns.org> <20160713201823.GB29670@mtj.duckdns.org> <20160713202657.GW30154@twins.programming.kicks-ass.net> <20160713203944.GC29670@mtj.duckdns.org> <20160713205102.GZ30909@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160713205102.GZ30909@twins.programming.kicks-ass.net> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 13, 2016 at 10:51:02PM +0200, Peter Zijlstra wrote: > On Wed, Jul 13, 2016 at 04:39:44PM -0400, Tejun Heo wrote: > So, IIRC, the trade-off is a full memory barrier in read_lock and > read_unlock() vs sync_sched() in write. > > Full memory barriers are expensive and while the combined cost might > well exceed the cost of the sync_sched() it doesn't suffer the latency > issues. Given the way read side is used for percpu_rwsem, full memory barrier on reader side shouldn't matter at all. The paths are not *that* hot. > Not sure if we can frob the two in a single codebase, but I can have a > poke if Oleg or Paul doesn't beat me to it. At the simplest, it can be rwsem equivalence of lglock. -- tejun