mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
sched: Consolidate select_task_rq() callers
Small cleanup. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> [ v2: build fix ] Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
6b314d0e11
commit
970b13bacb
1 changed files with 11 additions and 3 deletions
|
@ -2323,6 +2323,14 @@ void task_oncpu_function_call(struct task_struct *p,
|
|||
preempt_enable();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
static inline
|
||||
int select_task_rq(struct task_struct *p, int sd_flags, int wake_flags)
|
||||
{
|
||||
return p->sched_class->select_task_rq(p, sd_flags, wake_flags);
|
||||
}
|
||||
#endif
|
||||
|
||||
/***
|
||||
* try_to_wake_up - wake up a thread
|
||||
* @p: the to-be-woken-up thread
|
||||
|
@ -2376,7 +2384,7 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
|
|||
p->state = TASK_WAKING;
|
||||
task_rq_unlock(rq, &flags);
|
||||
|
||||
cpu = p->sched_class->select_task_rq(p, SD_BALANCE_WAKE, wake_flags);
|
||||
cpu = select_task_rq(p, SD_BALANCE_WAKE, wake_flags);
|
||||
if (cpu != orig_cpu) {
|
||||
local_irq_save(flags);
|
||||
rq = cpu_rq(cpu);
|
||||
|
@ -2593,7 +2601,7 @@ void sched_fork(struct task_struct *p, int clone_flags)
|
|||
p->sched_class = &fair_sched_class;
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
cpu = p->sched_class->select_task_rq(p, SD_BALANCE_FORK, 0);
|
||||
cpu = select_task_rq(p, SD_BALANCE_FORK, 0);
|
||||
#endif
|
||||
local_irq_save(flags);
|
||||
update_rq_clock(cpu_rq(cpu));
|
||||
|
@ -3156,7 +3164,7 @@ static void sched_migrate_task(struct task_struct *p, int dest_cpu)
|
|||
void sched_exec(void)
|
||||
{
|
||||
int new_cpu, this_cpu = get_cpu();
|
||||
new_cpu = current->sched_class->select_task_rq(current, SD_BALANCE_EXEC, 0);
|
||||
new_cpu = select_task_rq(current, SD_BALANCE_EXEC, 0);
|
||||
put_cpu();
|
||||
if (new_cpu != this_cpu)
|
||||
sched_migrate_task(current, new_cpu);
|
||||
|
|
Loading…
Reference in a new issue