From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933161AbcFOW6T (ORCPT ); Wed, 15 Jun 2016 18:58:19 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:24414 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932327AbcFOW6S (ORCPT ); Wed, 15 Jun 2016 18:58:18 -0400 X-IBM-Helo: d01dlp02.pok.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Wed, 15 Jun 2016 15:58:13 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Subject: Re: [PATCH tip/core/rcu 09/12] rcu: Make call_rcu_tasks() tolerate first call with irqs disabled Reply-To: paulmck@linux.vnet.ibm.com References: <20160615214550.GA4931@linux.vnet.ibm.com> <1466027173-5501-9-git-send-email-paulmck@linux.vnet.ibm.com> <20160615221604.GC30921@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160615221604.GC30921@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16061522-0056-0000-0000-000000882D93 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16061522-0057-0000-0000-000004A18951 Message-Id: <20160615225813.GC3923@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-15_13:,, 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-1604210000 definitions=main-1606150241 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 16, 2016 at 12:16:04AM +0200, Peter Zijlstra wrote: > On Wed, Jun 15, 2016 at 02:46:10PM -0700, Paul E. McKenney wrote: > > Currently, if the very first call to call_rcu_tasks() has irqs disabled, > > it will create the rcu_tasks_kthread with irqs disabled, which will > > result in a splat in the memory allocator, which kthread_run() invokes > > with the expectation that irqs are enabled. > > > > This commit fixes this problem by deferring kthread creation if called > > with irqs disabled. The first call to call_rcu_tasks() that has irqs > > enabled will create the kthread. > > > > This bug was detected by rcutorture changes that were motivated by > > Iftekhar Ahmed's mutation-testing efforts. > > Seems fragile. What if someone manages to only use call_rcu_tasks() with > IRQs disabled? It would have to have users before that could possibly happen. :-/ And it would not be hard to remove the fragility if needed by setting up a workqueue, possibly mediated by a timer or whatever. But it is hard to motivate myself to do so in advance of users. For that matter... Steven, is call_rcu_tasks() needed, or should I just rip it out? Thanx, Paul