History

sched/core: WARN() when migrating to an offline CPU

Migrating tasks to offline CPUs is a pretty big fail, warn about it.

Peter Zijlstra committed 9 years ago

Commit 4ff90831 parent edd8e411 file · +4 −0Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/sched/core.c+4−0
@@ -1173,6 +1173,10 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu) · 1172 unmodified lines
11731173 WARN_ON_ONCE(debug_locks && !(lockdep_is_held(&p->pi_lock) ||
11741174 lockdep_is_held(&task_rq(p)->lock)));
11751175 #endif
1176+ /*
1177+ * Clearly, migrating tasks to offline CPUs is a fairly daft thing.
1178+ */
1179+ WARN_ON_ONCE(!cpu_online(new_cpu));
11761180 #endif
11771181
11781182 trace_sched_migrate_task(p, new_cpu);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t