Skip to content

Commit

Permalink
sched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_…
Browse files Browse the repository at this point in the history
…rq()

The function for_each_cpu_mask() expects a *pointer* to struct
cpumask as its second argument, whereas select_fallback_rq()
passes the value itself.

And moreover, for_each_cpu_mask() has been marked as obselete
in include/linux/cpumask.h. So move to the more appropriate
for_each_cpu() variant.

Reported-by: Sasha Levin <[email protected]>
Signed-off-by: Srivatsa S. Bhat <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Cc: Dave Jones <[email protected]>
Cc: Liu Chuansheng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Srivatsa S. Bhat authored and Ingo Molnar committed Mar 31, 2012
1 parent 1f56ee7 commit e3831ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
int dest_cpu;

/* Look for allowed, online CPU in same node. */
for_each_cpu_mask(dest_cpu, *nodemask) {
for_each_cpu(dest_cpu, nodemask) {
if (!cpu_online(dest_cpu))
continue;
if (!cpu_active(dest_cpu))
Expand All @@ -1279,7 +1279,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)

for (;;) {
/* Any allowed, online CPU? */
for_each_cpu_mask(dest_cpu, *tsk_cpus_allowed(p)) {
for_each_cpu(dest_cpu, tsk_cpus_allowed(p)) {
if (!cpu_online(dest_cpu))
continue;
if (!cpu_active(dest_cpu))
Expand Down

0 comments on commit e3831ed

Please sign in to comment.