diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-04-19 06:11:10 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-02 09:15:51 -0400 |
commit | bcf08df3b23b3d13bf8c4ad6bd744a6ad30015fb (patch) | |
tree | c3c37cfa34a15c05a37bbacc7b67a2ffc19bc856 /kernel/sched_rt.c | |
parent | 693525e3bea25cf2ee6cf2b862ba7c148e891df2 (diff) |
sched: Fix cpupri build on !CONFIG_SMP
This build bug:
In file included from kernel/sched.c:1765:
kernel/sched_rt.c: In function ‘has_pushable_tasks’:
kernel/sched_rt.c:1069: error: ‘struct rt_rq’ has no member named ‘pushable_tasks’
kernel/sched_rt.c: In function ‘pick_next_task_rt’:
kernel/sched_rt.c:1084: error: ‘struct rq’ has no member named ‘post_schedule’
Triggers because both pushable_tasks and post_schedule are
SMP-only fields.
Move pushable_tasks() to the SMP section and #ifdef the post_schedule use.
Cc: Gregory Haskins <ghaskins@novell.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20090729150422.17691.55590.stgit@dev.haskins.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r-- | kernel/sched_rt.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index f365e66b3d49..3d4020a9ba1b 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -136,6 +136,11 @@ static void dequeue_pushable_task(struct rq *rq, struct task_struct *p) | |||
136 | plist_del(&p->pushable_tasks, &rq->rt.pushable_tasks); | 136 | plist_del(&p->pushable_tasks, &rq->rt.pushable_tasks); |
137 | } | 137 | } |
138 | 138 | ||
139 | static inline int has_pushable_tasks(struct rq *rq) | ||
140 | { | ||
141 | return !plist_head_empty(&rq->rt.pushable_tasks); | ||
142 | } | ||
143 | |||
139 | #else | 144 | #else |
140 | 145 | ||
141 | static inline void enqueue_pushable_task(struct rq *rq, struct task_struct *p) | 146 | static inline void enqueue_pushable_task(struct rq *rq, struct task_struct *p) |
@@ -1064,11 +1069,6 @@ static struct task_struct *_pick_next_task_rt(struct rq *rq) | |||
1064 | return p; | 1069 | return p; |
1065 | } | 1070 | } |
1066 | 1071 | ||
1067 | static inline int has_pushable_tasks(struct rq *rq) | ||
1068 | { | ||
1069 | return !plist_head_empty(&rq->rt.pushable_tasks); | ||
1070 | } | ||
1071 | |||
1072 | static struct task_struct *pick_next_task_rt(struct rq *rq) | 1072 | static struct task_struct *pick_next_task_rt(struct rq *rq) |
1073 | { | 1073 | { |
1074 | struct task_struct *p = _pick_next_task_rt(rq); | 1074 | struct task_struct *p = _pick_next_task_rt(rq); |
@@ -1077,11 +1077,13 @@ static struct task_struct *pick_next_task_rt(struct rq *rq) | |||
1077 | if (p) | 1077 | if (p) |
1078 | dequeue_pushable_task(rq, p); | 1078 | dequeue_pushable_task(rq, p); |
1079 | 1079 | ||
1080 | #ifdef CONFIG_SMP | ||
1080 | /* | 1081 | /* |
1081 | * We detect this state here so that we can avoid taking the RQ | 1082 | * We detect this state here so that we can avoid taking the RQ |
1082 | * lock again later if there is no need to push | 1083 | * lock again later if there is no need to push |
1083 | */ | 1084 | */ |
1084 | rq->post_schedule = has_pushable_tasks(rq); | 1085 | rq->post_schedule = has_pushable_tasks(rq); |
1086 | #endif | ||
1085 | 1087 | ||
1086 | return p; | 1088 | return p; |
1087 | } | 1089 | } |