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)
5498
5498
void sched_exec (void )
5499
5499
{
5500
5500
struct task_struct * p = current ;
5501
- unsigned long flags ;
5501
+ struct migration_arg arg ;
5502
5502
int dest_cpu ;
5503
5503
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 ;
5508
5508
5509
- if (likely ( cpu_active (dest_cpu ))) {
5510
- struct migration_arg arg = { p , dest_cpu } ;
5509
+ if (unlikely (! cpu_active (dest_cpu )))
5510
+ return ;
5511
5511
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 };
5515
5513
}
5516
- unlock :
5517
- raw_spin_unlock_irqrestore (& p -> pi_lock , flags );
5514
+ stop_one_cpu (task_cpu (p ), migration_cpu_stop , & arg );
5518
5515
}
5519
5516
5520
5517
#endif
You can’t perform that action at this time.
0 commit comments