From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751352AbcGNRvl (ORCPT ); Thu, 14 Jul 2016 13:51:41 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:36293 "EHLO mail-oi0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751051AbcGNRvj (ORCPT ); Thu, 14 Jul 2016 13:51:39 -0400 MIME-Version: 1.0 In-Reply-To: <20160714174111.GA15816@redhat.com> 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> <20160714131809.GO30927@twins.programming.kicks-ass.net> <20160714164945.GH30154@twins.programming.kicks-ass.net> <20160714171311.GB13434@redhat.com> <20160714174111.GA15816@redhat.com> From: John Stultz Date: Thu, 14 Jul 2016 10:51:37 -0700 Message-ID: Subject: Re: Severe performance regression w/ 4.4+ on Android due to cgroup locking changes To: Oleg Nesterov Cc: Peter Zijlstra , Tejun Heo , Ingo Molnar , lkml , Dmitry Shmidt , Rom Lemarchand , Colin Cross , Todd Kjos , "Paul E. McKenney" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 14, 2016 at 10:41 AM, Oleg Nesterov wrote: > On 07/14, John Stultz wrote: >> >> I'm not supposed to be applying this on-top of >> Paul's change, right? > > Right, unless I am totally confused, > >> > 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); >> > + >> >> >> So adding this does make a huge difference ontop of Peter's patch. > > Ah, sorry for confusion. I meant, you could try this one-liner without > any other changes. So the one-liner without other changes helps at a similar level as Paul's change. From some simple testing I've got a 3.5ms spike, but otherwise the values are under 200us. > But we will need the "slow mode optimization" part from Peter's patch > anyway, otherwise percpu_rw_semaphore simply makes no sense for > cgroup_threadgroup_rwsem. Yea, with Peter's patch it is further improved. thanks -john