From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] [POWERPC] Fix thinko in cpu_thread_mask_to_cores()
Date: Fri, 22 Feb 2008 14:26:43 +1100 [thread overview]
Message-ID: <20080222032708.689FFDDE08@ozlabs.org> (raw)
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>
---
include/asm-powerpc/cputhreads.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-work.orig/include/asm-powerpc/cputhreads.h 2008-02-22 14:22:34.000000000 +1100
+++ linux-work/include/asm-powerpc/cputhreads.h 2008-02-22 14:22:39.000000000 +1100
@@ -35,7 +35,7 @@ static inline cpumask_t cpu_thread_mask_
res = CPU_MASK_NONE;
for (i = 0; i < NR_CPUS; i += threads_per_core) {
- cpus_shift_right(tmp, threads_core_mask, i);
+ cpus_shift_left(tmp, threads_core_mask, i);
if (cpus_intersects(threads, tmp))
cpu_set(i, res);
}
next reply other threads:[~2008-02-22 3:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-22 3:26 Benjamin Herrenschmidt [this message]
2008-02-22 3:42 ` [PATCH] [POWERPC] Fix thinko in cpu_thread_mask_to_cores() Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080222032708.689FFDDE08@ozlabs.org \
--to=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox