From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751696AbcGNRMz (ORCPT ); Thu, 14 Jul 2016 13:12:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42801 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751674AbcGNRMx (ORCPT ); Thu, 14 Jul 2016 13:12:53 -0400 Date: Thu, 14 Jul 2016 19:13:12 +0200 From: Oleg Nesterov To: John Stultz Cc: Peter Zijlstra , Tejun Heo , Ingo Molnar , lkml , Dmitry Shmidt , Rom Lemarchand , Colin Cross , Todd Kjos , "Paul E. McKenney" Subject: Re: Severe performance regression w/ 4.4+ on Android due to cgroup locking changes Message-ID: <20160714171311.GB13434@redhat.com> References: <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> <20160714131809.GO30927@twins.programming.kicks-ass.net> <20160714164945.GH30154@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 14 Jul 2016 17:12:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/14, John Stultz wrote: > > So I am seeing synchronize_sched called, and its taking the > !rcu_gp_is_expedited path when I see the particularly bad latencies. > > I wonder if I just mucked up applying the patch? Probably yes... Just in case, could you try the patch below? Of course, without other optimizations from Peter, this change makes cgroup_threadgroup_rwsem much worse than a plain rw_semaphore. Oleg. --- x/kernel/cgroup.c +++ x/kernel/cgroup.c @@ -5605,6 +5605,8 @@ int __init cgroup_init(void) BUG_ON(cgroup_init_cftypes(NULL, cgroup_dfl_base_files)); BUG_ON(cgroup_init_cftypes(NULL, cgroup_legacy_base_files)); + rcu_sync_enter(&cgroup_threadgroup_rwsem.rss); + get_user_ns(init_cgroup_ns.user_ns); mutex_lock(&cgroup_mutex);