diff options
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 68db5a2e6545..01fd131b47a4 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2323,6 +2323,14 @@ void task_oncpu_function_call(struct task_struct *p, | |||
2323 | preempt_enable(); | 2323 | preempt_enable(); |
2324 | } | 2324 | } |
2325 | 2325 | ||
2326 | #ifdef CONFIG_SMP | ||
2327 | static inline | ||
2328 | int select_task_rq(struct task_struct *p, int sd_flags, int wake_flags) | ||
2329 | { | ||
2330 | return p->sched_class->select_task_rq(p, sd_flags, wake_flags); | ||
2331 | } | ||
2332 | #endif | ||
2333 | |||
2326 | /*** | 2334 | /*** |
2327 | * try_to_wake_up - wake up a thread | 2335 | * try_to_wake_up - wake up a thread |
2328 | * @p: the to-be-woken-up thread | 2336 | * @p: the to-be-woken-up thread |
@@ -2376,7 +2384,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state, | |||
2376 | p->state = TASK_WAKING; | 2384 | p->state = TASK_WAKING; |
2377 | task_rq_unlock(rq, &flags); | 2385 | task_rq_unlock(rq, &flags); |
2378 | 2386 | ||
2379 | cpu = p->sched_class->select_task_rq(p, SD_BALANCE_WAKE, wake_flags); | 2387 | cpu = select_task_rq(p, SD_BALANCE_WAKE, wake_flags); |
2380 | if (cpu != orig_cpu) { | 2388 | if (cpu != orig_cpu) { |
2381 | local_irq_save(flags); | 2389 | local_irq_save(flags); |
2382 | rq = cpu_rq(cpu); | 2390 | rq = cpu_rq(cpu); |
@@ -2593,7 +2601,7 @@ void sched_fork(struct task_struct *p, int clone_flags) | |||
2593 | p->sched_class = &fair_sched_class; | 2601 | p->sched_class = &fair_sched_class; |
2594 | 2602 | ||
2595 | #ifdef CONFIG_SMP | 2603 | #ifdef CONFIG_SMP |
2596 | cpu = p->sched_class->select_task_rq(p, SD_BALANCE_FORK, 0); | 2604 | cpu = select_task_rq(p, SD_BALANCE_FORK, 0); |
2597 | #endif | 2605 | #endif |
2598 | local_irq_save(flags); | 2606 | local_irq_save(flags); |
2599 | update_rq_clock(cpu_rq(cpu)); | 2607 | update_rq_clock(cpu_rq(cpu)); |
@@ -3156,7 +3164,7 @@ out: | |||
3156 | void sched_exec(void) | 3164 | void sched_exec(void) |
3157 | { | 3165 | { |
3158 | int new_cpu, this_cpu = get_cpu(); | 3166 | int new_cpu, this_cpu = get_cpu(); |
3159 | new_cpu = current->sched_class->select_task_rq(current, SD_BALANCE_EXEC, 0); | 3167 | new_cpu = select_task_rq(current, SD_BALANCE_EXEC, 0); |
3160 | put_cpu(); | 3168 | put_cpu(); |
3161 | if (new_cpu != this_cpu) | 3169 | if (new_cpu != this_cpu) |
3162 | sched_migrate_task(current, new_cpu); | 3170 | sched_migrate_task(current, new_cpu); |