From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753771AbcFOWQO (ORCPT ); Wed, 15 Jun 2016 18:16:14 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:51366 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752578AbcFOWQM (ORCPT ); Wed, 15 Jun 2016 18:16:12 -0400 Date: Thu, 16 Jun 2016 00:16:04 +0200 From: Peter Zijlstra To: "Paul E. McKenney" 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 Message-ID: <20160615221604.GC30921@twins.programming.kicks-ass.net> References: <20160615214550.GA4931@linux.vnet.ibm.com> <1466027173-5501-9-git-send-email-paulmck@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466027173-5501-9-git-send-email-paulmck@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?