Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754803AbXJWRGm (ORCPT ); Tue, 23 Oct 2007 13:06:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754640AbXJWRFW (ORCPT ); Tue, 23 Oct 2007 13:05:22 -0400 Received: from 75-130-111-13.dhcp.oxfr.ma.charter.com ([75.130.111.13]:35048 "EHLO novell1.haskins.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754630AbXJWRFT (ORCPT ); Tue, 23 Oct 2007 13:05:19 -0400 From: Gregory Haskins Subject: [PATCH 04/13] RT: Wrap the RQ notion of priority to make it conditional To: linux-rt-users@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Gregory Haskins , Steven Rostedt , Dmitry Adamushko , Peter Zijlstra , Ingo Molnar , Darren Hart Date: Tue, 23 Oct 2007 12:50:44 -0400 Message-ID: <20071023165044.5536.32230.stgit@novell1.haskins.net> In-Reply-To: <20071023164156.5536.95573.stgit@novell1.haskins.net> References: <20071023164156.5536.95573.stgit@novell1.haskins.net> User-Agent: StGIT/0.12.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1448 Lines: 48 A little cleanup to avoid #ifdef proliferation later in the series Signed-off-by: Gregory Haskins --- kernel/sched.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/kernel/sched.c b/kernel/sched.c index e22eec7..dfd0b92 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -365,6 +365,16 @@ struct rq { static DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); static DEFINE_MUTEX(sched_hotcpu_mutex); +#if defined(CONFIG_PREEMPT_RT) && defined(CONFIG_SMP) +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); @@ -2329,9 +2339,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) /* - 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/