[PATCH 04/13] RT: Wrap the RQ notion of priority to make it conditional

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gregory Haskins
Date: Tuesday, October 23, 2007 - 9:50 am

A little cleanup to avoid #ifdef proliferation later in the series

Signed-off-by: Gregory Haskins <ghaskins@novell.com>
---

 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)
 	/*

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/13] Balance RT tasks v5, Gregory Haskins, (Tue Oct 23, 9:50 am)
[PATCH 01/13] RT: push-rt, Gregory Haskins, (Tue Oct 23, 9:50 am)
[PATCH 03/13] RT: Add a per-cpu rt_overload indication, Gregory Haskins, (Tue Oct 23, 9:50 am)
[PATCH 04/13] RT: Wrap the RQ notion of priority to make i ..., Gregory Haskins, (Tue Oct 23, 9:50 am)
[PATCH 05/13] RT: Initialize the priority value, Gregory Haskins, (Tue Oct 23, 9:50 am)
[PATCH 06/13] RT: Maintain the highest RQ priority, Gregory Haskins, (Tue Oct 23, 9:50 am)
[PATCH 07/13] RT: Clean up some of the push-rt logic, Gregory Haskins, (Tue Oct 23, 9:50 am)
[PATCH 10/13] RT: Fixes for push-rt patch, Gregory Haskins, (Tue Oct 23, 9:51 am)
[PATCH 11/13] RT: Condense NORMAL and IDLE priorities, Gregory Haskins, (Tue Oct 23, 9:51 am)
[PATCH 12/13] RT: CPU priority management, Gregory Haskins, (Tue Oct 23, 9:51 am)