mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: mm-commits@vger.kernel.org, andreas.herrmann3@amd.com,
	gcosta@redhat.com, mingo@elte.hu, tglx@linutronix.de,
	travis@sgi.com
Subject: Re: + x86-show-cpuinfo-only-for-online-cpus.patch added to -mm tree
Date: Thu, 1 Nov 2007 15:31:23 -0700	[thread overview]
Message-ID: <86802c440711011531u5a8a4872r3b4c33e5fd0fd0c9@mail.gmail.com> (raw)
In-Reply-To: <20071101193932.8A44D432BDC@localhost>

On Nov 1, 2007 12:39 PM,  <akpm@linux-foundation.org> wrote:
>
> The patch titled
>      x86: show cpuinfo only for online CPUs
> has been added to the -mm tree.  Its filename is
>      x86-show-cpuinfo-only-for-online-cpus.patch
>
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
>
> See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
> out what to do about this
>
> ------------------------------------------------------
> Subject: x86: show cpuinfo only for online CPUs
> From: "Andreas Herrmann" <andreas.herrmann3@amd.com>
>
> Fix regressions introduced with 92cb7612aee39642d109b8d935ad265e602c0563.
>
> It can happen that cpuinfo is displayed for CPUs that are not online or
> even worse for CPUs not present at all. As an example, following was
> shown for a "second" CPU of a single core K8 variant:
>
>     processor       : 0
>     vendor_id       : unknown
>     cpu family      : 0
>     model           : 0
>     model name      : unknown
>     stepping        : 0
>     cache size      : 0 KB
>     fpu             : yes
>     fpu_exception   : yes
>     cpuid level     : 0
>     wp              : yes
>     flags           :
>     bogomips        : 0.00
>     clflush size    : 0
>     cache_alignment : 0
>     address sizes   : 0 bits physical, 0 bits virtual
>     power management:
>
> Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
> Cc: Glauber de Oliveira Costa <gcosta@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@elte.hu>
> Cc: Mike Travis <travis@sgi.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
>  arch/x86/kernel/cpu/proc.c |    8 +++-----
>  arch/x86/kernel/setup_64.c |    8 +++-----
>  2 files changed, 6 insertions(+), 10 deletions(-)
>
...
> diff -puN arch/x86/kernel/setup_64.c~x86-show-cpuinfo-only-for-online-cpus arch/x86/kernel/setup_64.c
> --- a/arch/x86/kernel/setup_64.c~x86-show-cpuinfo-only-for-online-cpus
> +++ a/arch/x86/kernel/setup_64.c
> @@ -1131,8 +1131,6 @@ static int show_cpuinfo(struct seq_file
>
>
>  #ifdef CONFIG_SMP
> -       if (!cpu_online(c->cpu_index))
> -               return 0;
>         cpu = c->cpu_index;
>  #endif

wonder if could change

>       if (!cpu_online(c->cpu_index))
>               return 0;

==>

>       if (c->cpu_index >= NR_CPUS)
>               return 0;

and add another entry for every cpu
online : 1 when it is enabled
or online : 0 when it is disabled by /sys/devices/system/cpuX/online.

YH

       reply	other threads:[~2007-11-01 22:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20071101193932.8A44D432BDC@localhost>
2007-11-01 22:31 ` Yinghai Lu [this message]
2007-11-06 19:20   ` Andreas Herrmann

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=86802c440711011531u5a8a4872r3b4c33e5fd0fd0c9@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=andreas.herrmann3@amd.com \
    --cc=gcosta@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mm-commits@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=travis@sgi.com \
    /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®