diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-10-15 11:00:15 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-10-15 11:00:15 -0400 |
commit | d5036e89dcf7c19b3d03219d7d385bc96965b7fe (patch) | |
tree | dbb040c61bc645abde2c4ea91605beb43d370607 /kernel | |
parent | 3a5e4dc12f23fb96fafd4f5d0f61e6c3070f80a5 (diff) |
sched: clean up is_migration_thread()
clean up is_migration_thread() and turn it into an inline function.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 2c6295b395a9..7ef66bd753e7 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -75,12 +75,6 @@ unsigned long long __attribute__((weak)) sched_clock(void) | |||
75 | return (unsigned long long)jiffies * (1000000000 / HZ); | 75 | return (unsigned long long)jiffies * (1000000000 / HZ); |
76 | } | 76 | } |
77 | 77 | ||
78 | #ifdef CONFIG_SMP | ||
79 | #define is_migration_thread(p, rq) ((p) == (rq)->migration_thread) | ||
80 | #else | ||
81 | #define is_migration_thread(p, rq) 0 | ||
82 | #endif | ||
83 | |||
84 | /* | 78 | /* |
85 | * Convert user-nice values [ -20 ... 0 ... 19 ] | 79 | * Convert user-nice values [ -20 ... 0 ... 19 ] |
86 | * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ], | 80 | * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ], |
@@ -371,6 +365,15 @@ static inline int cpu_of(struct rq *rq) | |||
371 | #endif | 365 | #endif |
372 | } | 366 | } |
373 | 367 | ||
368 | static inline int is_migration_thread(struct task_struct *p, struct rq *rq) | ||
369 | { | ||
370 | #ifdef CONFIG_SMP | ||
371 | return p == rq->migration_thread; | ||
372 | #else | ||
373 | return 0; | ||
374 | #endif | ||
375 | } | ||
376 | |||
374 | /* | 377 | /* |
375 | * Update the per-runqueue clock, as finegrained as the platform can give | 378 | * Update the per-runqueue clock, as finegrained as the platform can give |
376 | * us, but without assuming monotonicity, etc.: | 379 | * us, but without assuming monotonicity, etc.: |