From patchwork Thu Jun 30 07:47:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonsoo Kim X-Patchwork-Id: 9206829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AAC5D60752 for ; Thu, 30 Jun 2016 07:46:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D9FA284F5 for ; Thu, 30 Jun 2016 07:46:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9239B285BA; Thu, 30 Jun 2016 07:46:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1B0F8284F5 for ; Thu, 30 Jun 2016 07:46:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIWeJ-0007Pz-OW; Thu, 30 Jun 2016 07:44:35 +0000 Received: from lgeamrelo11.lge.com ([156.147.23.51]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIWeG-0007F1-8x for linux-arm-kernel@lists.infradead.org; Thu, 30 Jun 2016 07:44:34 +0000 Received: from unknown (HELO lgeamrelo02.lge.com) (156.147.1.126) by 156.147.23.51 with ESMTP; 30 Jun 2016 16:44:07 +0900 X-Original-SENDERIP: 156.147.1.126 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Received: from unknown (HELO localhost) (10.177.222.138) by 156.147.1.126 with ESMTP; 30 Jun 2016 16:44:07 +0900 X-Original-SENDERIP: 10.177.222.138 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Thu, 30 Jun 2016 16:47:10 +0900 From: Joonsoo Kim To: "Paul E. McKenney" Subject: Re: Boot failure on emev2/kzm9d (was: Re: [PATCH v2 11/11] mm/slab: lockless decision to grow cache) Message-ID: <20160630074710.GC30114@js1304-P5Q-DELUXE> References: <20160622190859.GA1473@linux.vnet.ibm.com> <20160623004935.GA20752@linux.vnet.ibm.com> <20160623023756.GA30438@js1304-P5Q-DELUXE> <20160623024742.GD1473@linux.vnet.ibm.com> <20160623025329.GA13095@linux.vnet.ibm.com> <20160629164415.GG4650@linux.vnet.ibm.com> <20160629181208.GP4650@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160629181208.GP4650@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160630_004432_730109_A419B4E7 X-CRM114-Status: GOOD ( 32.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pekka Enberg , Jesper Dangaard Brouer , "linux-kernel@vger.kernel.org" , Linux-Renesas , Linux MM , Geert Uytterhoeven , David Rientjes , Andrew Morton , Christoph Lameter , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Jun 29, 2016 at 11:12:08AM -0700, Paul E. McKenney wrote: > On Wed, Jun 29, 2016 at 07:52:06PM +0200, Geert Uytterhoeven wrote: > > Hi Paul, > > > > On Wed, Jun 29, 2016 at 6:44 PM, Paul E. McKenney > > wrote: > > > On Wed, Jun 29, 2016 at 04:54:44PM +0200, Geert Uytterhoeven wrote: > > >> On Thu, Jun 23, 2016 at 4:53 AM, Paul E. McKenney > > >> wrote: > > >> > On Wed, Jun 22, 2016 at 07:47:42PM -0700, Paul E. McKenney wrote: > > > > > > [ . . . ] > > > > > >> > @@ -4720,11 +4720,18 @@ static void __init rcu_dump_rcu_node_tree(struct rcu_state *rsp) > > >> > pr_info(" "); > > >> > level = rnp->level; > > >> > } > > >> > - pr_cont("%d:%d ^%d ", rnp->grplo, rnp->grphi, rnp->grpnum); > > >> > + pr_cont("%d:%d/%#lx/%#lx ^%d ", rnp->grplo, rnp->grphi, > > >> > + rnp->qsmask, > > >> > + rnp->qsmaskinit | rnp->qsmaskinitnext, rnp->grpnum); > > >> > } > > >> > pr_cont("\n"); > > >> > } > > >> > > >> For me it always crashes during the 37th call of synchronize_sched() in > > >> setup_kmem_cache_node(), which is the first call after secondary CPU bring up. > > >> With your and my debug code, I get: > > >> > > >> CPU: Testing write buffer coherency: ok > > >> CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 > > >> Setting up static identity map for 0x40100000 - 0x40100058 > > >> cnt = 36, sync > > >> CPU1: thread -1, cpu 1, socket 0, mpidr 80000001 > > >> Brought up 2 CPUs > > >> SMP: Total of 2 processors activated (2132.00 BogoMIPS). > > >> CPU: All CPU(s) started in SVC mode. > > >> rcu_node tree layout dump > > >> 0:1/0x0/0x3 ^0 > > > > > > Thank you for running this! > > > > > > OK, so RCU knows about both CPUs (the "0x3"), and the previous > > > grace period has seen quiescent states from both of them (the "0x0"). > > > That would indicate that your synchronize_sched() showed up when RCU was > > > idle, so it had to start a new grace period. It also rules out failure > > > modes where RCU thinks that there are more CPUs than really exist. > > > (Don't laugh, such things have really happened.) > > > > > >> devtmpfs: initialized > > >> VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 1 > > >> clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, > > >> max_idle_ns: 19112604462750000 ns > > >> > > >> I hope it helps. Thanks! > > > > > > I am going to guess that this was the first grace period since the second > > > CPU came online. When there only on CPU online, synchronize_sched() > > > is a no-op. > > > > > > OK, this showed some things that aren't a problem. What might the > > > problem be? > > > > > > o The grace-period kthread has not yet started. It -should- start > > > at early_initcall() time, but who knows? Adding code to print > > > out that kthread's task_struct address. > > > > > > o The grace-period kthread might not be responding to wakeups. > > > Checking this requires that a grace period be in progress, > > > so please put a call_rcu_sched() just before the call to > > > rcu_dump_rcu_node_tree(). (Sample code below.) Adding code > > > to my patch to print out more GP-kthread state as well. > > > > > > o One of the CPUs might not be responding to RCU. That -should- > > > result in an RCU CPU stall warning, so I will ignore this > > > possibility for the moment. > > > > > > That said, do you have some way to determine whether scheduling > > > clock interrupts are really happening? Without these interrupts, > > > no RCU CPU stall warnings. > > > > I believe there are no clocksources yet. The jiffies clocksource is the first > > clocksource found, and that happens after the first call to > > synchronize_sched(), cfr. my dmesg snippet above. > > > > In a working boot: > > # cat /sys/bus/clocksource/devices/clocksource0/available_clocksource > > e0180000.timer jiffies > > # cat /sys/bus/clocksource/devices/clocksource0/current_clocksource > > e0180000.timer > > Ah! But if there is no jiffies clocksource, then schedule_timeout() > and friends will never return, correct? If so, I guarantee you that > synchronize_sched() will unconditionally hang. > > So if I understand correctly, the fix is to get the jiffies clocksource > running before the first call to synchronize_sched(). If so, following change would be sufficient. Thanks. ------>8------- diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c index 555e21f..4f6471f 100644 --- a/kernel/time/jiffies.c +++ b/kernel/time/jiffies.c @@ -98,7 +98,7 @@ static int __init init_jiffies_clocksource(void) return __clocksource_register(&clocksource_jiffies); } -core_initcall(init_jiffies_clocksource); +early_initcall(init_jiffies_clocksource); struct clocksource * __init __weak clocksource_default_clock(void) {