File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1972,14 +1972,25 @@ static int migration_cpu_stop(void *data)
1972
1972
complete = true;
1973
1973
}
1974
1974
1975
- if (dest_cpu < 0 )
1975
+ if (dest_cpu < 0 ) {
1976
+ if (cpumask_test_cpu (task_cpu (p ), & p -> cpus_mask ))
1977
+ goto out ;
1978
+
1976
1979
dest_cpu = cpumask_any_distribute (& p -> cpus_mask );
1980
+ }
1977
1981
1978
1982
if (task_on_rq_queued (p ))
1979
1983
rq = __migrate_task (rq , & rf , p , dest_cpu );
1980
1984
else
1981
1985
p -> wake_cpu = dest_cpu ;
1982
1986
1987
+ /*
1988
+ * XXX __migrate_task() can fail, at which point we might end
1989
+ * up running on a dodgy CPU, AFAICT this can only happen
1990
+ * during CPU hotplug, at which point we'll get pushed out
1991
+ * anyway, so it's probably not a big deal.
1992
+ */
1993
+
1983
1994
} else if (pending ) {
1984
1995
/*
1985
1996
* This happens when we get migrated between migrate_enable()'s
You can’t perform that action at this time.
0 commit comments