public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: Jeff Sipek <jeffpc@optonline.net>
Cc: castet.matthieu@free.fr, linux-kernel@vger.kernel.org
Subject: Re: [patch] bug in cpuid & msr on nosmp machine
Date: Thu, 20 May 2004 02:51:40 -0700	[thread overview]
Message-ID: <20040520025140.02e13b73.pj@sgi.com> (raw)
In-Reply-To: <200405192245.07235.jeffpc@optonline.net>

Jeff wrote:
> but on nosmp machine if the cpu!=0 this procude a BUG();

The line you refer to here is, I believe, in include/linux/cpumask.h:

  #ifdef CONFIG_SMP
    ...
  #else
    ...
  #define cpu_online(cpu)    ({ BUG_ON((cpu) != 0); 1; })
    ...
  #endif

Any thoughts on whether that BUG() is serving any useful purpose?

I'm of a mind to have the non-SMP case of cpu_online(cpu) simply
respond true (1) hardcoded:

  #define cpu_online(cpu)    (1)

Or at least remove the BUG and have it respond true iff cpu == 0:

  #define cpu_online(cpu)    ((cpu) == 0)

While theoretically correct, that BUG() is, so far as I know, of
no redeeming social value.  And it wastes a few bytes of kernel
text space each time cpu_online() is used on an SMP, and causes
the occassional confusion, as in this case.

-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

  reply	other threads:[~2004-05-20  9:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-19 16:35 [patch] bug in cpuid & msr on nosmp machine matthieu castet
2004-05-19 17:46 ` matthieu castet
2004-05-20  2:44 ` Jeff Sipek
2004-05-20  9:51   ` Paul Jackson [this message]
2004-05-20  7:32 ` Andrew Morton
2004-05-20  8:34   ` Rusty Russell
2004-05-20  8:51     ` Andrew Morton
2004-05-20  9:30       ` Rusty Russell
2004-05-20  9:57       ` Rusty Russell
     [not found] <1XCh4-1jO-67@gated-at.bofh.it>
     [not found] ` <1XRg3-4LW-31@gated-at.bofh.it>
     [not found]   ` <1XRg3-4LW-29@gated-at.bofh.it>
     [not found]     ` <1XSc3-5y3-23@gated-at.bofh.it>
2004-05-22  8:13       ` Andi Kleen

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=20040520025140.02e13b73.pj@sgi.com \
    --to=pj@sgi.com \
    --cc=castet.matthieu@free.fr \
    --cc=jeffpc@optonline.net \
    --cc=linux-kernel@vger.kernel.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