From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753824AbdDKV5F (ORCPT ); Tue, 11 Apr 2017 17:57:05 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56863 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753785AbdDKV5D (ORCPT ); Tue, 11 Apr 2017 17:57:03 -0400 Date: Tue, 11 Apr 2017 14:56:56 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: linux-kernel@vger.kernel.org Subject: Re: There is a Tasks RCU stall warning Reply-To: paulmck@linux.vnet.ibm.com References: <20170411211802.GA19165@linux.vnet.ibm.com> <20170411173133.52b28cfe@gandalf.local.home> <20170411173447.0bdb9f77@gandalf.local.home> <20170411173900.00f4b6c6@gandalf.local.home> <20170411214443.GH1600@linux.vnet.ibm.com> <20170411174953.46adbf1e@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170411174953.46adbf1e@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17041121-0024-0000-0000-000002427102 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006919; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00846213; UDB=6.00417371; IPR=6.00624647; BA=6.00005284; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015010; XFM=3.00000013; UTC=2017-04-11 21:57:00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17041121-0025-0000-0000-0000434A4ADB Message-Id: <20170411215656.GI1600@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-11_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-1702020001 definitions=main-1704110169 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 11, 2017 at 05:49:53PM -0400, Steven Rostedt wrote: > On Tue, 11 Apr 2017 14:44:43 -0700 > "Paul E. McKenney" wrote: > > > > Works for me! > > > > Hopefully it will also work for your computer. :-) > > > > And whew! Glad to see that the stall warnings worked! > > Ah! but I think I found a bug in synchronize_rcu_tasks()! > > Calling schedule isn't good enough. For rcu_tasks to continue, the task > needs to schedule out. With my updated code, I just triggered: > > [ 196.276868] INFO: rcu_tasks detected stalls on tasks: > [ 196.284294] ffff8800c26f8040: .. nvcsw: 2/2 holdout: 1 idle_cpu: -1/1 > [ 196.293175] event_benchmark R running task 30536 1127 2 0x10000000 > [ 196.302746] Call Trace: > [ 196.307640] ? _raw_spin_unlock_irq+0x1f/0x50 > [ 196.314453] __schedule+0x222/0x1210 > [ 196.320476] ? pci_mmcfg_check_reserved+0xc0/0xc0 > [ 196.327616] ? preempt_count_add+0xb7/0xf0 > [ 196.334174] ? __asan_store8+0x15/0x70 > [ 196.340384] schedule+0x57/0xe0 > [ 196.345888] benchmark_event_kthread+0x2e/0x3c0 > [ 196.352823] kthread+0x178/0x1d0 > [ 196.358411] ? trace_benchmark_reg+0x80/0x80 > [ 196.365073] ? kthread_create_on_node+0xa0/0xa0 > [ 196.371999] ret_from_fork+0x2e/0x40 > > > And here my benchmark called schedule(), but nothing scheduled it out, > and it still fails on rcu_tasks. Good point! Hmmmm... I cannot hook into rcu_note_context_switch() because that gets called for preemption as well as for voluntary context switches. How about cond_resched_rcu_qs()? Does that cover it? Thanx, Paul