From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750951AbdAMRDF (ORCPT ); Fri, 13 Jan 2017 12:03:05 -0500 Received: from mail.skyhub.de ([78.46.96.112]:56136 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbdAMRDE (ORCPT ); Fri, 13 Jan 2017 12:03:04 -0500 Date: Fri, 13 Jan 2017 18:02:54 +0100 From: Borislav Petkov To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, lv.zheng@intel.com, stan.kain@gmail.com, waffolz@hotmail.com, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, mingo@kernel.org, torvalds@linux-foundation.org, rafael@kernel.org Subject: Re: [PATCH] rcu: Narrow early boot window of illegal synchronous grace periods Message-ID: <20170113170254.qtozzrewvoa6qct7@pd.tnic> References: <20170113023807.GA27120@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170113023807.GA27120@linux.vnet.ibm.com> User-Agent: NeoMutt/20161014 (1.7.1) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 12, 2017 at 06:38:07PM -0800, Paul E. McKenney wrote: > The current preemptible RCU implementation goes through three phases > during bootup. In the first phase, there is only one CPU that is running > with preemption disabled, so that a no-op is a synchronous grace period. > In the second mid-boot phase, the scheduler is running, but RCU has > not yet gotten its kthreads spawned (and, for expedited grace periods, > workqueues are not yet running. During this time, any attempt to do > a synchronous grace period will hang the system (or complain bitterly, > depending). In the third and final phase, RCU is fully operational and > everything works normally. > > This has been OK for some time, but there has recently been some > synchronous grace periods showing up during the second mid-boot phase. > This commit therefore reworks RCU to permit synchronous grace periods > to proceed during this mid-boot phase. > > This commit accomplishes this by setting a flag from the existing > rcu_scheduler_starting() function which causes all synchronous grace > periods to take the expedited path. The expedited path now checks this > flag, using the requesting task to drive the expedited grace period > forward during the mid-boot phase. Finally, this flag is updated by a > core_initcall() function named rcu_exp_runtime_mode(), which causes the > runtime codepaths to be used. > > Note that this arrangement assumes that tasks are not sent POSIX signals > (or anything similar) from the time that the first task is spawned > through core_initcall() time. > > Reported-by: "Zheng, Lv" > Reported-by: Borislav Petkov > Signed-off-by: Paul E. McKenney Tested on a bunch of boxes I have access to, looks good. Tested-by: Borislav Petkov -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.