[PATCH 02/10] scbed/fair: Remove duplicate check for busiest_cpu in active_load_balance_cpu_stop()
Xin Zhao <[email protected]>
| Newsgroups | org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
The check for cpu_active(busiest_cpu) already ensures that busiest_cpu has not gone down. An additional check for busiest_cpu != smp_processor_id() is redundant. After this modification, busiest_cpu will no longer be bound to smp_processor_id(), allowing the active_load_balance_cpu_stop function to accommodate more scenarios, such as preempt active balancing feature that will be addressed in later patches. Signed-off-by: Xin Zhao <[email protected]> --- kernel/sched/fair.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 13e873b1ef58..11c104010b2e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -13769,9 +13769,7 @@ static int active_load_balance_cpu_stop(void *data) if (!cpu_active(busiest_cpu) || !cpu_active(target_cpu)) goto out_unlock; - /* Make sure the requested CPU hasn't gone down in the meantime: */ - if (unlikely(busiest_cpu != smp_processor_id() || - !busiest_rq->active_balance)) + if (unlikely(!busiest_rq->active_balance)) goto out_unlock; /* Is there any task to move? */ -- 2.34.1