File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -7320,10 +7320,12 @@ static void balance_push_set(int cpu, bool on)
7320
7320
struct rq_flags rf ;
7321
7321
7322
7322
rq_lock_irqsave (rq , & rf );
7323
- if (on )
7323
+ if (on ) {
7324
+ WARN_ON_ONCE (rq -> balance_callback );
7324
7325
rq -> balance_callback = & balance_push_callback ;
7325
- else
7326
+ } else if ( rq -> balance_callback == & balance_push_callback ) {
7326
7327
rq -> balance_callback = NULL ;
7328
+ }
7327
7329
rq_unlock_irqrestore (rq , & rf );
7328
7330
}
7329
7331
@@ -7441,6 +7443,10 @@ int sched_cpu_activate(unsigned int cpu)
7441
7443
struct rq * rq = cpu_rq (cpu );
7442
7444
struct rq_flags rf ;
7443
7445
7446
+ /*
7447
+ * Make sure that when the hotplug state machine does a roll-back
7448
+ * we clear balance_push. Ideally that would happen earlier...
7449
+ */
7444
7450
balance_push_set (cpu , false);
7445
7451
7446
7452
#ifdef CONFIG_SCHED_SMT
@@ -7608,6 +7614,12 @@ int sched_cpu_dying(unsigned int cpu)
7608
7614
}
7609
7615
rq_unlock_irqrestore (rq , & rf );
7610
7616
7617
+ /*
7618
+ * Now that the CPU is offline, make sure we're welcome
7619
+ * to new tasks once we come back up.
7620
+ */
7621
+ balance_push_set (cpu , false);
7622
+
7611
7623
calc_load_migrate (rq );
7612
7624
update_max_interval ();
7613
7625
nohz_balance_exit_idle (rq );
You can’t perform that action at this time.
0 commit comments