From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754132AbbAUHCz (ORCPT ); Wed, 21 Jan 2015 02:02:55 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:42227 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752775AbbAUHCw (ORCPT ); Wed, 21 Jan 2015 02:02:52 -0500 Date: Tue, 20 Jan 2015 23:02:46 -0800 From: "Paul E. McKenney" To: Zhang Zhen Cc: Don Zickus , linux-kernel@vger.kernel.org, morgan.wang@huawei.com, josh@freedesktop.org, dipankar@in.ibm.com Subject: Re: RCU CPU stall console spews leads to soft lockup disabled is reasonable ? Message-ID: <20150121070246.GB9719@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <54BCBB33.6060608@huawei.com> <20150119084200.GE9719@linux.vnet.ibm.com> <54BCC89D.9040702@huawei.com> <20150119140612.GI116159@redhat.com> <54BDC6DF.6000602@huawei.com> <20150120152531.GR116159@redhat.com> <54BF0E53.5040409@huawei.com> <54BF1957.6080606@huawei.com> <54BF4D0D.3090500@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54BF4D0D.3090500@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15012107-0021-0000-0000-000007EFD578 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 21, 2015 at 02:54:05PM +0800, Zhang Zhen wrote: > On 2015/1/21 11:13, Zhang Zhen wrote: > > On 2015/1/21 10:26, Zhang Zhen wrote: > >> On 2015/1/20 23:25, Don Zickus wrote: [ . . . ] > > Sorry, i made a mistake, the log above is based on v3.10.63. > > I have tested the latest upstream kernel (based on ec6f34e5b552), > > but my test case can't triggered RCU stall warning. > > > > I used git bisect to find the bad commit, but found a irrelevant > commit(db5d711e2db776 zram: avoid null access when fail to alloc meta). > Before this commit, my test case can easily trigger RCU stall warning, > but after this commit, my test case can't trigger RCU stall warning. I have lost track of exactly what kernel you are using. If you are using a recent kernel (v3.18 or thereabouts), one thing to try is to apply my stack of RCU CPU stall-warning changes that are on their way in, please see v3.19-rc1..630181c4a915 in -rcu, which is at: git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git These handle the problems that Dave Jones and a few others located this past December. Could you please give them a spin? Thanx, Paul > I'm totally confused. > > My test case: > > // > #include > #include > #include > #include > #include > > struct foo { > int a; > char b; > long c; > }; > > struct foo gbl_foo = {1, 'a', 2}; > struct foo *pgbl_foo = &gbl_foo; > > static int my_kthread(void *data) > { > DEFINE_SPINLOCK(foo_mutex); > struct foo *new_fp; > struct foo *old_fp; > > new_fp = kmalloc(sizeof(*new_fp), GFP_KERNEL); > spin_lock(&foo_mutex); > old_fp = pgbl_foo; > *new_fp = *old_fp; > new_fp->a = 2; > rcu_assign_pointer(pgbl_foo, new_fp); > spin_unlock(&foo_mutex); > synchronize_rcu(); > kfree(old_fp); > > return 0; > } > > static int hello_start(void) > { > struct task_struct *my_task = NULL; > DEFINE_SPINLOCK(hello_lock); > > my_task = kthread_run(my_kthread, NULL, "my_thread%d", 1); > > spin_lock_init(&hello_lock); > spin_lock(&hello_lock); > spin_lock(&hello_lock); > return 0; > } > > static int __init test_init(void) > { > hello_start(); > > printk(KERN_INFO "Module init\n"); > return 0; > } > > static void __exit test_exit(void) > { > printk(KERN_INFO "Module exit!\n"); > } > > module_init(test_init) > module_exit(test_exit) > MODULE_LICENSE("GPL"); > // > >>> > >>> Cheers, > >>> Don > >>> > >>> diff --git a/kernel/watchdog.c b/kernel/watchdog.c > >>> index 70bf118..833c015 100644 > >>> --- a/kernel/watchdog.c > >>> +++ b/kernel/watchdog.c > >>> @@ -209,7 +209,7 @@ void touch_nmi_watchdog(void) > >>> * going off. > >>> */ > >>> raw_cpu_write(watchdog_nmi_touch, true); > >>> - touch_softlockup_watchdog(); > >>> + //touch_softlockup_watchdog(); > >>> } > >>> EXPORT_SYMBOL(touch_nmi_watchdog); > >>> > >>> > >>> . > >>> > >> > > > >