From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965243AbbI2OPy (ORCPT ); Tue, 29 Sep 2015 10:15:54 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:40944 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965059AbbI2OPq (ORCPT ); Tue, 29 Sep 2015 10:15:46 -0400 Date: Tue, 29 Sep 2015 16:09:46 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, fweisbec@gmail.com, oleg@redhat.com, umgwanakikbuti@gmail.com, rostedt@goodmis.org Subject: Re: [RFC][PATCH 02/11] sched: Create preempt_count invariant Message-ID: <20150929140946.GI3816@twins.programming.kicks-ass.net> References: <20150929092825.540553633@infradead.org> <20150929093519.817299442@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Sep 29, 2015 at 03:11:56PM +0200, Thomas Gleixner wrote: > On Tue, 29 Sep 2015, Peter Zijlstra wrote: > > + /* > > + * Still have preempt_count() == 2, from: > > + * > > + * schedule() > > + * preempt_disable(); // 1 > > + * __schedule() > > + * raw_spin_lock_irq(&rq->lock) // 2 > > + */ > > + rq = finish_task_switch(prev); /* drops rq->lock, preempt_count() == 1 */ > > balance_callback(rq); > > - preempt_enable(); > > + preempt_enable(); /* preempt_count() == 0 */ > > Bah. I so hate tail comments. What's wrong with > > + /* preempt_count() ==> 0 */ > preempt_enable(); > > Hmm? I find the tail comments more readable in this case; clearly I don't share your hatred :-). But I can change them if you insist.