diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-02-21 22:26:43 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-02-26 06:17:03 -0500 |
commit | 6a2d322e4b81edc2ab35573f1c52f93d1d16eebb (patch) | |
tree | 2a96cba53e6308588aae2c167255f269aba8e8c7 /include/asm-powerpc/cputhreads.h | |
parent | 50530378161fa8d7837243119ed9140ee65e55d4 (diff) |
[POWERPC] Fix thinko in cpu_thread_mask_to_cores()
The function cpu_thread_mask_to_cores() which returns a cpumask
of one and only one thread enabled for a given core has a bug
as it's shifting things in the wrong direction.
Note: The implementation is still sub-optimal in the sense that
for a given core, the thread set in the result may not be any of
the threads set in the input, which can lead to more IPIs then
strictly necessary, but it isn't incorrect per-se. I'll improve
that later.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/cputhreads.h')
-rw-r--r-- | include/asm-powerpc/cputhreads.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asm-powerpc/cputhreads.h b/include/asm-powerpc/cputhreads.h index 8485c28b5f47..fb11b0c459b8 100644 --- a/include/asm-powerpc/cputhreads.h +++ b/include/asm-powerpc/cputhreads.h | |||
@@ -35,7 +35,7 @@ static inline cpumask_t cpu_thread_mask_to_cores(cpumask_t threads) | |||
35 | 35 | ||
36 | res = CPU_MASK_NONE; | 36 | res = CPU_MASK_NONE; |
37 | for (i = 0; i < NR_CPUS; i += threads_per_core) { | 37 | for (i = 0; i < NR_CPUS; i += threads_per_core) { |
38 | cpus_shift_right(tmp, threads_core_mask, i); | 38 | cpus_shift_left(tmp, threads_core_mask, i); |
39 | if (cpus_intersects(threads, tmp)) | 39 | if (cpus_intersects(threads, tmp)) |
40 | cpu_set(i, res); | 40 | cpu_set(i, res); |
41 | } | 41 | } |