File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -5498,23 +5498,20 @@ unsigned int nr_iowait(void)
54985498void sched_exec (void )
54995499{
55005500 struct task_struct * p = current ;
5501- unsigned long flags ;
5501+ struct migration_arg arg ;
55025502 int dest_cpu ;
55035503
5504- raw_spin_lock_irqsave ( & p -> pi_lock , flags );
5505- dest_cpu = p -> sched_class -> select_task_rq (p , task_cpu (p ), WF_EXEC );
5506- if (dest_cpu == smp_processor_id ())
5507- goto unlock ;
5504+ scoped_guard ( raw_spinlock_irqsave , & p -> pi_lock ) {
5505+ dest_cpu = p -> sched_class -> select_task_rq (p , task_cpu (p ), WF_EXEC );
5506+ if (dest_cpu == smp_processor_id ())
5507+ return ;
55085508
5509- if (likely ( cpu_active (dest_cpu ))) {
5510- struct migration_arg arg = { p , dest_cpu } ;
5509+ if (unlikely (! cpu_active (dest_cpu )))
5510+ return ;
55115511
5512- raw_spin_unlock_irqrestore (& p -> pi_lock , flags );
5513- stop_one_cpu (task_cpu (p ), migration_cpu_stop , & arg );
5514- return ;
5512+ arg = (struct migration_arg ){ p , dest_cpu };
55155513 }
5516- unlock :
5517- raw_spin_unlock_irqrestore (& p -> pi_lock , flags );
5514+ stop_one_cpu (task_cpu (p ), migration_cpu_stop , & arg );
55185515}
55195516
55205517#endif
You can’t perform that action at this time.
0 commit comments