mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Mikael Pettersson <mikpe@csd.uu.se>
Cc: ak@suse.de, linux-kernel@vger.kernel.org
Subject: Re: 2.5.61: x86_64 num_online_cpus() buglet?
Date: Tue, 18 Feb 2003 07:31:11 +0100	[thread overview]
Message-ID: <20030218063111.GA14073@wotan.suse.de> (raw)
In-Reply-To: <200302171751.SAA19069@kim.it.uu.se>

On Mon, Feb 17, 2003 at 06:51:12PM +0100, Mikael Pettersson wrote:
> Andi,
> 
> Kernel 2.5.61's include/asm-x86_64/smp.h contains:
> 
> extern unsigned long cpu_online_map;
> ...
> extern inline unsigned int num_online_cpus(void)
> { 
> 	return hweight32(cpu_online_map);
> } 
> 
> and similarly for cpu_callout_map.
> 
> hweight32() truncates a 64-bit operand to 32-bits, so either
> - the maps should be int rather than long, or
> - x86_64 needs to define and use a new hweight64(), or
> - CONFIG_NR_CPUS must not exceed 32 on x86_64.
> 
> Comments?

You're right - it should use hweight64. Thanks for the headup.
I'll fix it.

Currently the x86-64 port is limited to 8 CPUs because the APIC
drivers don't support cluster mode (yet) and can only talk to 8 
local apics, so it isn't that harmful.

-Andi

  reply	other threads:[~2003-02-18  6:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-17 17:51 Mikael Pettersson
2003-02-18  6:31 ` Andi Kleen [this message]
2003-02-18  7:27   ` David S. Miller

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=20030218063111.GA14073@wotan.suse.de \
    --to=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@csd.uu.se \
    /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

all inboxes | Powered by JetHome®