From: Andi Kleen <andi@firstfloor.org>
To: "Frédéric Weisbecker" <fweisbec@gmail.com>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>,
Huang Ying <ying.huang@intel.com>,
"H. Peter Anvin" <hpa@zytor.com>, Andi Kleen <ak@linux.intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [BUGFIX -v7] x86, MCE: Fix bugs and issues of MCE log ring buffer
Date: Mon, 05 Oct 2009 17:16:37 +0200 [thread overview]
Message-ID: <87iqetyip6.fsf@basil.nowhere.org> (raw)
In-Reply-To: <c62985530910050151u78b46fa4l6ec0184f4f75be27@mail.gmail.com> (Frédéric Weisbecker's message of "Mon, 5 Oct 2009 10:51:46 +0200")
Frédéric Weisbecker <fweisbec@gmail.com> writes:
> So the need is to have a more stable ring buffer. But this one is an ad-hoc one.
It was designed to do one job and does it well with minimal overhead.
That seems all positive to me.
> We already have a general purpose per-cpu/lockless ring buffer implementation in
> kernel/trace/ring_buffer.c
> And it's not only used by tracing, it's generally available.
That trace ring buffer is significantly larger than the all rest of the MCE
code together:
andi@basil:~/lsrc/git/obj> size kernel/trace/ring_buffer.o
text data bss dec hex filename
14241 21 12 14274 37c2 kernel/trace/ring_buffer.o
andi@basil:~/lsrc/git/obj> size arch/x86/kernel/cpu/mcheck/mce.o
text data bss dec hex filename
11098 4480 224 15802 3dba arch/x86/kernel/cpu/mcheck/mce.o
Basically you're proposing to more than double the code footprint of the
MCE handler for a small kernel configuration, just to avoid a few lines
of code.
It might be that all of its features are needed for tracing, but they
are definitely not needed for MCE handling and it would need
to be put on a significant diet before core code like the MCE handler
could even think to start relying on it. In addition the ring-buffer.c
currently doesn't even directly do what mce needs and would need
significant glue code to fit into the existing interfaces and likely
modifications to the ring buffer itself too (e.g. to stop
trace_stop from messing with error handling)
Error handling code like the MCE handler has to be always compiled in
unlike tracing and other debugging options and I don't think it can
really afford to use such oversized code, especially since it doesn't
really need any of its fancy features. Linux has enough problems with
code size growth recently, no need to make it worse with proposals
like this. Also the requirements of error handling are quite different
from other tracing and debugging and the ring-buffer doesn't even fit
well recently.
If the code should be converted to use a generic buffer kernel/kfifo.o
would be the right target and size:
andi@basil:~/lsrc/git/obj> size kernel/kfifo.o
text data bss dec hex filename
734 0 0 734 2de kernel/kfifo.o
Unfortunately this needs Stefanie's lockless kfifo changes first to make
happen and they didn't make it into 2.6.32-rc*
If they make it into 2.6.33 and there's really a strong desire to use
some generalized buffer I think that would be a suitable solution.
But frankly just keeping Ying's buffer around would also be quite reasonable
Short term Ying's simple alternative is the only good solution.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
next prev parent reply other threads:[~2009-10-05 15:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-18 10:20 [BUGFIX -v7] x86, MCE: Fix bugs and issues of MCE log ring buffer Huang Ying
2009-09-18 11:09 ` Ingo Molnar
2009-09-21 5:37 ` Huang Ying
2009-09-22 13:39 ` [PATCH] x86: mce: New MCE logging design Ingo Molnar
2009-10-05 6:23 ` [BUGFIX -v7] x86, MCE: Fix bugs and issues of MCE log ring buffer Hidetoshi Seto
2009-10-05 6:33 ` [PATCH 01/10] x86, mce: remove tsc handling from mce_read Hidetoshi Seto
2009-10-05 6:34 ` [PATCH 02/10] x86, mce: mce_read can check args without mutex Hidetoshi Seto
2009-10-05 6:35 ` [PATCH 03/10] x86, mce: change writer timeout in mce_read Hidetoshi Seto
2009-10-05 6:36 ` [PATCH 04/10] x86, mce: use do-while in mce_log Hidetoshi Seto
2009-10-05 6:37 ` [PATCH 05/10] x86, mce: make mce_log buffer to per-CPU, prep Hidetoshi Seto
2009-10-05 6:38 ` [PATCH 06/10] x86, mce: make mce_log buffer to per-CPU Hidetoshi Seto
2009-10-05 7:06 ` Andi Kleen
2009-10-05 7:50 ` Hidetoshi Seto
2009-10-09 1:45 ` Huang Ying
2009-10-09 5:34 ` Hidetoshi Seto
2009-10-05 6:40 ` [PATCH 07/10] x86, mce: remove for-loop in mce_log Hidetoshi Seto
2009-10-05 6:41 ` [PATCH 08/10] x86, mce: change barriers " Hidetoshi Seto
2009-10-05 6:42 ` [PATCH 09/10] x86, mce: make mce_log buffer to ring buffer Hidetoshi Seto
2009-10-05 6:44 ` [PATCH 10/10] x86, mce: move mce_log_init() into mce_cap_init() Hidetoshi Seto
2009-10-05 7:07 ` [BUGFIX -v7] x86, MCE: Fix bugs and issues of MCE log ring buffer Hidetoshi Seto
2009-10-05 8:51 ` Frédéric Weisbecker
2009-10-05 15:16 ` Andi Kleen [this message]
2009-10-06 5:46 ` Hidetoshi Seto
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=87iqetyip6.fsf@basil.nowhere.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=seto.hidetoshi@jp.fujitsu.com \
--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;
as well as URLs for NNTP newsgroup(s).