From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933095AbXJOUAm (ORCPT ); Mon, 15 Oct 2007 16:00:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1765530AbXJOUAQ (ORCPT ); Mon, 15 Oct 2007 16:00:16 -0400 Received: from victor.provo.novell.com ([137.65.250.26]:53998 "EHLO victor.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763638AbXJOUAN (ORCPT ); Mon, 15 Oct 2007 16:00:13 -0400 Subject: Re: [PATCH 2/7] RT: Wrap the RQ notion of priority to make it conditional From: Gregory Haskins To: Steven Rostedt Cc: Peter Zijlstra , RT , Ingo Molnar , LKML , Thomas Gleixner In-Reply-To: References: <20071013001052.7444.8363.stgit@novell1.haskins.net> <20071013001543.7444.6025.stgit@novell1.haskins.net> Content-Type: text/plain Date: Mon, 15 Oct 2007 15:57:36 -0400 Message-Id: <1192478256.4067.85.camel@ghaskins-t60p.haskins.net> Mime-Version: 1.0 X-Mailer: Evolution 2.6.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2007-10-15 at 13:45 -0400, Steven Rostedt wrote: > > -- > > On Fri, 12 Oct 2007, Gregory Haskins wrote: > > > A little cleanup to avoid #ifdef proliferation later in the series > > > > Signed-off-by: Gregory Haskins > > NACK > > > --- > > > > kernel/sched.c | 23 ++++++++++++++++++++--- > > 1 files changed, 20 insertions(+), 3 deletions(-) > > > > diff --git a/kernel/sched.c b/kernel/sched.c > > index 0a1ad0e..c9afc8a 100644 > > --- a/kernel/sched.c > > +++ b/kernel/sched.c > > @@ -255,6 +255,10 @@ struct cfs_rq { > > #endif > > }; > > > > +#if defined(CONFIG_PREEMPT_RT) && defined(CONFIG_SMP) > > +#define ENABLE_RQ_PRIORITY /* Steve wants this conditional on PREEMPT_RT */ > > Yes, I do want it conditional. But only because we want to test it first, > so the condition is really temporary. I agree with Peter that this should > be for non PREEMPT_RT as well, and I'll work on a patch for upstream. > > But these defines setting defines is just ugly. Ok. Keep in mind the spirit of the patch was to wrap the setting so we didn't need more #ifdefs later, not so much to make that define. I can clean up the ifdef of ifdef part no problem. I was just trying to keep it one place to make the inevitable future change to share with non PREEMPT_RT easier ;) > > -- Steve > > > > +#endif /* CONFIG_PREEMPT_RT */ > > + > > /* Real-Time classes' related field in a runqueue: */ > > struct rt_rq { > > struct rt_prio_array active; > > @@ -304,6 +308,9 @@ struct rq { > > #ifdef CONFIG_PREEMPT_RT > > unsigned long rt_nr_running; > > unsigned long rt_nr_uninterruptible; > > +#endif > > + > > +#ifdef ENABLE_RQ_PRIORITY > > int curr_prio; > > #endif > > > > @@ -365,6 +372,16 @@ struct rq { > > static DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); > > static DEFINE_MUTEX(sched_hotcpu_mutex); > > > > +#ifdef ENABLE_RQ_PRIORITY > > +static inline void set_rq_prio(struct rq *rq, int prio) > > +{ > > + rq->curr_prio = prio; > > +} > > + > > +#else > > +#define set_rq_prio(rq, prio) do { } while(0) > > +#endif > > + > > static inline void check_preempt_curr(struct rq *rq, struct task_struct *p) > > { > > rq->curr->sched_class->check_preempt_curr(rq, p); > > @@ -2331,9 +2348,9 @@ static inline void finish_task_switch(struct rq *rq, struct task_struct *prev) > > */ > > prev_state = prev->state; > > _finish_arch_switch(prev); > > -#if defined(CONFIG_PREEMPT_RT) && defined(CONFIG_SMP) > > - rq->curr_prio = current->prio; > > -#endif > > + > > + set_rq_prio(rq, current->prio); > > + > > finish_lock_switch(rq, prev); > > #if defined(CONFIG_PREEMPT_RT) && defined(CONFIG_SMP) > > /* > > > > > >