From: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
To: Huang Ying <ying.huang@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Andi Kleen <ak@linux.intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -v4] x86: MCE: Re-implement MCE log ring buffer as per-CPU ring buffer
Date: Mon, 08 Jun 2009 12:09:57 +0900 [thread overview]
Message-ID: <4A2C8105.9030503@jp.fujitsu.com> (raw)
In-Reply-To: <1244426721.8361.569.camel@yhuang-dev.sh.intel.com>
Huang Ying wrote:
> Emm, it seem hard to analyze mce_log_cpu from per_cpu_var(mce_log_cpus),
> how about following method:
>
> struct mce_log {
> char signature[12];
> ...
> struct mce_log_cpu *mcelog_cpus[];
> };
>
> void mcelog_init(void)
> {
> int cpu;
> mcelog.mcelog_cpus = kmalloc(sizeof(void *) * num_possible_cpus();
> for_each_possible_cpu(cpu)
> mcelog.mcelog_cpus[cpu] = &per_cpu(mce_log_cpus, cpu);
> }
It would be good. Using kzalloc() will be better.
It might be a bit much, but how about adding:
+ mcelog.nr_mcelog_cpus = num_possible_cpus();
Be careful that mcheck_init(), caller of mcelog_init(), will be called
for each booted CPU. You will need:
+ if (mcelog.mcelog_cpus)
+ return;
Thanks,
H.Seto
prev parent reply other threads:[~2009-06-08 3:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-04 3:11 [PATCH -v4] x86: MCE: Re-implement MCE log ring buffer as per-CPU ring buffer Huang Ying
2009-06-04 5:56 ` Andi Kleen
2009-06-05 7:01 ` Hidetoshi Seto
2009-06-05 8:08 ` Huang Ying
2009-06-05 8:28 ` Hidetoshi Seto
2009-06-05 8:39 ` Huang Ying
2009-06-08 1:17 ` Hidetoshi Seto
2009-06-08 2:05 ` Huang Ying
2009-06-08 3:09 ` Hidetoshi Seto [this message]
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=4A2C8105.9030503@jp.fujitsu.com \
--to=seto.hidetoshi@jp.fujitsu.com \
--cc=ak@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=ying.huang@intel.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