From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755678AbbI2PKh (ORCPT ); Tue, 29 Sep 2015 11:10:37 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:60553 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751717AbbI2PKa (ORCPT ); Tue, 29 Sep 2015 11:10:30 -0400 Date: Tue, 29 Sep 2015 17:05:02 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, fweisbec@gmail.com, oleg@redhat.com, umgwanakikbuti@gmail.com, tglx@linutronix.de Subject: Re: [RFC][PATCH 01/11] sched: Simplify INIT_PREEMPT_COUNT Message-ID: <20150929150502.GN3816@twins.programming.kicks-ass.net> References: <20150929092825.540553633@infradead.org> <20150929093519.706413197@infradead.org> <20150929103729.00899e69@gandalf.local.home> <20150929143559.GL3816@twins.programming.kicks-ass.net> <20150929110049.7b9de3eb@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150929110049.7b9de3eb@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 Tue, Sep 29, 2015 at 11:00:49AM -0400, Steven Rostedt wrote: > > [ Resend, with the Cc list back ] You seem to have a hard time with these buttons today ;-) > Hmm, I just looked closer and I'm wondering if this still works? > > We have: > > #ifdef CONFIG_PREEMPT_COUNT > #define PREEMPT_DISABLED (1 + PREEMPT_ENABLED) > #else > #define PREEMPT_DISABLED PREEMPT_ENABLED > #endif > > Now if we just remove the PREEMPT_ACTIVE from the INIT_PREEMPT_COUNT, > when CONFIG_PREEMPT_COUNT is not set, wouldn't a _cond_resched() in > boot up schedule? Good point, PREEMPT_COUNT isn't required for voluntary preemption; when I tested the voluntary build nothing bad happened, but that could have been luck of course. So what we can do is use an unconditional 1 for INIT_PREEMPT_COUNT, such that the init task will have a raised preempt_count() during boot, even on !PREEMPT_COUNT kernels. But that means we cannot use INIT_PREEMPT_COUNT for init_task_preempt_count() and such like, as I wanted to. I'll make FORK_PREEMPT_COUNT for that instead.