All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: Tao Jiang <jiangtao.jit@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: A problem with percpu variable cpu_number
Date: Sun, 19 Feb 2012 23:21:23 +0800	[thread overview]
Message-ID: <4F411373.50304@gmail.com> (raw)
In-Reply-To: <CAOe6JY2W8H2FMbMUsUp=72gH6y_SXPvjwZ0fqOwXWUdknr=7yQ@mail.gmail.com>

On 02/19/2012 08:20 PM, Tao Jiang wrote:
> Hi :
>
> At the beginning of start_kernel() -- init/main.c
> boot_cpu_init() is called
>
> and in boot_cpu_init() will call smp_processor_id()
> it's a macro
> and it will be expanded as (percpu_read(cpu_number)) and so on
>
> but i noticed that it's before setup_per_cpu_areas() in start_kernel()
> is that mean the percpu areas hadn't be initialized yet
> but why smp_processor_id() could be called before setup_per_cpu_areas()

It doesn't matter, as the percpu var 'cpu_number' is defined statically: 
DECLARE_PER_CPU(int, cpu_number);.

Thanks.

  reply	other threads:[~2012-02-19 15:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16 11:09 A problem with percpu variable cpu_number tao jiang
2012-02-19 12:20 ` Tao Jiang
2012-02-19 15:21   ` Cong Wang [this message]
2012-02-20 11:04     ` Tao Jiang
2012-02-20 15:11       ` Cong Wang
2012-02-21 12:41         ` Tao Jiang
2012-02-21 14:29           ` Cong Wang
2012-02-21 17:58             ` Brian Gerst
2012-02-22 11:13               ` Tao Jiang
2012-02-22 13:21                 ` Hillf Danton
2012-02-23 14:29                   ` Tao Jiang

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=4F411373.50304@gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=jiangtao.jit@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.