From: Huang Ying <ying.huang@intel.com>
To: Andi Kleen <andi@firstfloor.org>
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 -v2] x86: MCE: Re-implement MCE log ring buffer as per-CPU ring buffer
Date: Wed, 29 Apr 2009 09:31:49 +0800 [thread overview]
Message-ID: <1240968709.6842.1175.camel@yhuang-dev.sh.intel.com> (raw)
In-Reply-To: <87eivdqdsq.fsf@basil.nowhere.org>
[-- Attachment #1: Type: text/plain, Size: 1725 bytes --]
On Tue, 2009-04-28 at 18:21 +0800, Andi Kleen wrote:
> Huang Ying <ying.huang@intel.com> writes:
> >
> > ChangeLog:
> >
> > v2:
> >
> > - Use alloc_percpu() to allocate per_cpu mcelog buffer
>
> Sorry, why didn't you just use DEFINE_PER_CPU ? That should work
> as well and will be shorter.
OK. I can do that.
> Another thing I noticed. the "MACHINECHECK" signature was originally
> for crash dump tools to find the log. If you change the format
> you should change it to MACHINECHEC2 or so.
Oh, thanks, I will change this.
> > + size_t usize_limit;
> > +
> > + /* Too large user buffer size may cause system not response */
> > + usize_limit = num_possible_cpus() * MCE_LOG_LEN * sizeof(struct mce);
> > + if (usize > usize_limit)
> > + usize = usize_limit;
>
> Did you ever track down what happens here? I still find it worrying
Maybe the comment is a little confusing. What we do is limit the size of
user buffer size to prevent system from not response. If the user buffer
size is limited, the time taken by mce_read() can be reasonable, and
will not cause system not to response.
But maybe num_possible_cpus() * MCE_LOG_LEN is not a good upper limit,
because possible cpus can be fairly large. Maybe we can add another
limit, something as follow:
#define MCE_READ_RECORD_LIMIT 512
/*
* Too large user buffer size may cause system not response, so constrain
* the effective size of user buffer
*/
usize_limit = num_possible_cpus() * MCE_LOG_LEN * sizeof(struct mce);
if (usize_limit > MCE_RECOARD_LIMIT * sizeof(struct mce))
usize_limit = MCE_RECOARD_LIMIT * sizeof(struct mce);
if (usize > usize_limit)
usize = usize_limit;
Best Regards,
Huang Ying
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-04-29 1:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-28 9:27 Huang Ying
2009-04-28 10:21 ` Andi Kleen
2009-04-29 1:31 ` Huang Ying [this message]
2009-04-29 6:11 ` Andi Kleen
2009-04-29 6:50 ` Huang Ying
2009-04-28 10:21 ` Peter Zijlstra
2009-04-28 10:33 ` 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=1240968709.6842.1175.camel@yhuang-dev.sh.intel.com \
--to=ying.huang@intel.com \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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®