Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751665AbaAPSm6 (ORCPT ); Thu, 16 Jan 2014 13:42:58 -0500 Received: from merlin.infradead.org ([205.233.59.134]:44936 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751246AbaAPSm5 (ORCPT ); Thu, 16 Jan 2014 13:42:57 -0500 Date: Thu, 16 Jan 2014 19:42:51 +0100 From: Peter Zijlstra To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Ingo Molnar , Andrew Morton , Thomas Gleixner , Frederic Weisbecker , Clark Williams Subject: Re: [RFC][PATCH 0/2] preempt: Track unmatched preempt_enable() to preempt_disable() Message-ID: <20140116184251.GA11314@laptop.programming.kicks-ass.net> References: <20140116171824.748919700@goodmis.org> <20140116174536.GB9655@laptop.programming.kicks-ass.net> <20140116133906.50bcbc93@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140116133906.50bcbc93@gandalf.local.home> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2014 at 01:39:06PM -0500, Steven Rostedt wrote: > On Thu, 16 Jan 2014 18:45:36 +0100 > Peter Zijlstra wrote: > > > On Thu, Jan 16, 2014 at 12:18:24PM -0500, Steven Rostedt wrote: > > > > Didn't see anything horrible in there, so fine with me. > > > > Another thing I recently ran into was: > > > > local_irq_disable(); > > preempt_disable(); > > local_irq_enable(); > > > > local_irq_disable(); > > preempt_enable(); > > local_irq_enable(); > > > > I'm not sure any of our debugging catches that, I meant to extend > > lockdep, but maybe it could also be hooked into something else. > > Hmm, what's wrong with the above? Suppose a reschedule interrupt happens in the middle; we set NEED_RESCHED but won't act because preempt is disabled. When we hit preempt_enable() we'll call into preempt_schedule() but fail because preemptible() finds irqs_disabled(). And in the end we do not schedule, but have NEED_RESCHED set. FAIL. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/