From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752765AbcGONjT (ORCPT ); Fri, 15 Jul 2016 09:39:19 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:65520 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751498AbcGONjQ (ORCPT ); Fri, 15 Jul 2016 09:39:16 -0400 X-IBM-Helo: d01dlp02.pok.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com Date: Fri, 15 Jul 2016 06:39:28 -0700 From: "Paul E. McKenney" To: Oleg Nesterov Cc: Peter Zijlstra , mingo@kernel.org, linux-kernel@vger.kernel.org, tj@kernel.org, john.stultz@linaro.org, dimitrysh@google.com, romlem@google.com, ccross@google.com, tkjos@google.com Subject: Re: [PATCH 2/2] locking/percpu-rwsem: Introduce bias knob Reply-To: paulmck@linux.vnet.ibm.com References: <20160714182545.786693675@infradead.org> <20160714183022.336211504@infradead.org> <20160714184351.GA18388@redhat.com> <20160714192018.GM30154@twins.programming.kicks-ass.net> <20160715132709.GA27644@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160715132709.GA27644@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16071513-0044-0000-0000-000000A97F27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16071513-0045-0000-0000-000004BFA0F0 Message-Id: <20160715133928.GH7094@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-07-15_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607150145 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 15, 2016 at 03:27:09PM +0200, Oleg Nesterov wrote: > On 07/14, Peter Zijlstra wrote: > > > > On Thu, Jul 14, 2016 at 08:43:51PM +0200, Oleg Nesterov wrote: > > > > > > Oh well... I personally do not think this is what we want... Can't > > > we just add the stupid rcu_sync_enter() into cgroup_init() at least > > > for now? Yes, this means the unnecessary .sync() at boot time, but > > > it will go away after cleanups I am going to send. > > > > Something like so then? > > OK, agreed, > > > --- > > --- a/include/linux/rcu_sync.h > > +++ b/include/linux/rcu_sync.h > > @@ -59,6 +59,7 @@ static inline bool rcu_sync_is_idle(stru > > } > > > > extern void rcu_sync_init(struct rcu_sync *, enum rcu_sync_type); > > +extern void rcu_sync_sabotage(struct rcu_sync *); > > extern void rcu_sync_enter(struct rcu_sync *); > > extern void rcu_sync_exit(struct rcu_sync *); > > extern void rcu_sync_dtor(struct rcu_sync *); > > --- a/kernel/cgroup.c > > +++ b/kernel/cgroup.c > > @@ -5609,6 +5609,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_sabotage(&cgroup_threadgroup_rwsem.rss); > > Heh ;) I too think it should be renamed. I'd suggest > > __rcu_sync_enter(rss); > > although I do not really mind and agree with any name. Hmmm... Why not just move the checks out into the caller? That would make the intent much more clear. Thanx, Paul > Hopefully I'll send some cleanups soon, rcu_sync_enter() will be > re-implemented as > > rcu_sync_enter(rss) > { > if (__rcu_sync_enter(rss)) > __rcu_sync_wait(rss); > } > > > + * rcu_sync_sabotage() - Sabotage a fresh rcu_sync instance > > + * @rsp: Pointer to rcu_sync structure to be sabotaged > > + * > > + * Must be called after rcu_sync_init() and before first use. > > OK. And after those cleanups __rcu_sync_enter() can be called at any > time. > > Oleg. >