From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032488AbdAIXwQ (ORCPT ); Mon, 9 Jan 2017 18:52:16 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48919 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764425AbdAIXwN (ORCPT ); Mon, 9 Jan 2017 18:52:13 -0500 Date: Mon, 9 Jan 2017 15:52:06 -0800 From: "Paul E. McKenney" To: Borislav Petkov Cc: "Zheng, Lv" , "Rafael J. Wysocki" , "Wysocki, Rafael J" , "Moore, Robert" , J?rg R?del , lkml , Linux ACPI Subject: Re: 174cc7187e6f ACPICA: Tables: Back port acpi_get_table_with_size() and early_acpi_os_unmap_memory() from Linux kernel Reply-To: paulmck@linux.vnet.ibm.com References: <20170108130355.vxhjmj6dlkqw6hyq@pd.tnic> <1AE640813FDE7649BE1B193DEA596E886CE27B7E@SHSMSX101.ccr.corp.intel.com> <1AE640813FDE7649BE1B193DEA596E886CE27BEE@SHSMSX101.ccr.corp.intel.com> <20170109093329.jd7uwlcpci4icpd3@pd.tnic> <20170109221831.GC3800@linux.vnet.ibm.com> <20170109231501.xrhwsv46mznw3kqt@pd.tnic> <20170109233204.GG3800@linux.vnet.ibm.com> <20170109234039.mfefmv5dv4shxnfn@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170109234039.mfefmv5dv4shxnfn@pd.tnic> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17010923-0016-0000-0000-0000059862B0 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006404; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000199; SDB=6.00805275; UDB=6.00391913; IPR=6.00582896; BA=6.00005038; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013871; XFM=3.00000011; UTC=2017-01-09 23:52:11 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17010923-0017-0000-0000-0000361EB63C Message-Id: <20170109235206.GH3800@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-09_16:,, 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-1612050000 definitions=main-1701090319 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 10, 2017 at 12:40:39AM +0100, Borislav Petkov wrote: > On Mon, Jan 09, 2017 at 03:32:04PM -0800, Paul E. McKenney wrote: > > We could move rcu_scheduler_starting() later, as long as there > > is no chance of preemption or context switch before it is invoked. > > Would that help in this case, or are we already context switching before > > acpi_os_map_cleanup() is invoked? (If we are already context switching, > > short-circuiting synchronize_rcu_expedited() would be a bug.) > > Hmm, how about the below? > > It would still happen before > > /* > * The boot idle thread must execute schedule() > * at least once to get things moving: > */ > init_idle_bootup_task(current); > schedule_preempt_disabled(); > > in rest_init() and right after native_smp_prepare_cpus() which is where > we're splatting. > > Lemme run it. > > Even if it works, we would have to stress-test this seriously... Yeah, the call to wait_for_completion() at the beginning of kernel_init_freeable() makes me extremely nervous. Even if it does happen to work, this looks like an accident waiting to happen. Is it possible to instead move the ACPI initialization to follow the workqueue initialization? Thanx, Paul > --- > diff --git a/init/main.c b/init/main.c > index b0c9d6facef9..9be221cc87c3 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -385,7 +385,6 @@ static noinline void __ref rest_init(void) > { > int pid; > > - rcu_scheduler_starting(); > /* > * We need to spawn init first so that it obtains pid 1, however > * the init task will end up wanting to create kthreads, which, if > @@ -1019,6 +1018,8 @@ static noinline void __init kernel_init_freeable(void) > > smp_prepare_cpus(setup_max_cpus); > > + rcu_scheduler_starting(); > + > workqueue_init(); > > do_pre_smp_initcalls(); > > > -- > Regards/Gruss, > Boris. > > Good mailing practices for 400: avoid top-posting and trim the reply. >