Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967071AbbBDRsy (ORCPT ); Wed, 4 Feb 2015 12:48:54 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:35640 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966657AbbBDRsw (ORCPT ); Wed, 4 Feb 2015 12:48:52 -0500 Date: Wed, 4 Feb 2015 18:48:45 +0100 From: Peter Zijlstra To: Frederic Weisbecker Cc: Ingo Molnar , LKML , Steven Rostedt , Linus Torvalds Subject: Re: [PATCH 3/4] sched: Pull preemption disablement to __schedule() caller Message-ID: <20150204174845.GE5029@twins.programming.kicks-ass.net> References: <1422404652-29067-1-git-send-email-fweisbec@gmail.com> <1422404652-29067-4-git-send-email-fweisbec@gmail.com> <20150128155044.GJ23038@twins.programming.kicks-ass.net> <20150202175343.GD11054@lerouge> <20150203105303.GI26304@twins.programming.kicks-ass.net> <20150204173152.GA24000@lerouge> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150204173152.GA24000@lerouge> 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 Content-Length: 1285 Lines: 30 On Wed, Feb 04, 2015 at 06:31:57PM +0100, Frederic Weisbecker wrote: > > In any case; if we make __schedule() noinline (I think that might make > > sense) that function call would itself imply the compiler barrier and > > something like: > > > > __preempt_count_add(PREEMPT_ACTIVE + PREEMPT_CHECK_OFFSET); > > __schedule(); > > __preempt_count_sub(PREEMPT_ACTIVE + PREEMPT_CHECK_OFFSET); > > > > Would actually be safe/correct. > > > > As it stands I think __schedule() would fail the GCC inline static > > criteria for being too large, but you never know, noinline guarantees it > > will not. > > Right, although relying only on __schedule() as a function call is perhaps > error-prone in case we add things in preempt_schedule*() APIs later, before > the call to __schedule(), that need the preempt count to be visible. > > I can create preempt_active_enter() / preempt_active_exit() that take care > of the preempt op and the barrier() for example. Sure, like that exception_enter() in preempt_schedule_context() for instance? -- 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/