Skip to content

Commit

Permalink
[PATCH] sched: hardcode non-smp set_cpus_allowed
Browse files Browse the repository at this point in the history
Simplify the UP (1 CPU) implementatin of set_cpus_allowed.

The one CPU is hardcoded to be cpu 0 - so just test for that bit, and avoid
having to pick up the cpu_online_map.

Also, unexport cpu_online_map: it was only needed for set_cpus_allowed().

Signed-off-by: Paul Jackson <pj@sgi.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Paul Jackson authored and Linus Torvalds committed Oct 31, 2005
1 parent 70a6a0c commit 4098f99
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ extern int set_cpus_allowed(task_t *p, cpumask_t new_mask);
#else
static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask)
{
if (!cpus_intersects(new_mask, cpu_online_map))
if (!cpu_isset(0, new_mask))
return -EINVAL;
return 0;
}
Expand Down
1 change: 0 additions & 1 deletion kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3877,7 +3877,6 @@ EXPORT_SYMBOL(cpu_present_map);

#ifndef CONFIG_SMP
cpumask_t cpu_online_map = CPU_MASK_ALL;
EXPORT_SYMBOL_GPL(cpu_online_map);
cpumask_t cpu_possible_map = CPU_MASK_ALL;
#endif

Expand Down

0 comments on commit 4098f99

Please sign in to comment.