Migrating tasks to offline CPUs is a pretty big fail, warn about it.
Unified · Split
| @@ -1173,6 +1173,10 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu) · 1172 unmodified lines | ||
| 1173 | 1173 | WARN_ON_ONCE(debug_locks && !(lockdep_is_held(&p->pi_lock) || |
| 1174 | 1174 | lockdep_is_held(&task_rq(p)->lock))); |
| 1175 | 1175 | #endif |
| 1176 | + /* | |
| 1177 | + * Clearly, migrating tasks to offline CPUs is a fairly daft thing. | |
| 1178 | + */ | |
| 1179 | + WARN_ON_ONCE(!cpu_online(new_cpu)); | |
| 1176 | 1180 | #endif |
| 1177 | 1181 | |
| 1178 | 1182 | trace_sched_migrate_task(p, new_cpu); |