From: Stefan Assmann <sassmann@kpanic.de>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-mm@kvack.org, tony.luck@intel.com, mingo@elte.hu,
hpa@zytor.com, rick@vanrein.org, akpm@linux-foundation.org,
lwoodman@redhat.com, riel@redhat.com
Subject: Re: [RFC PATCH 2/3] support for broken memory modules (BadRAM)
Date: Fri, 29 Apr 2011 11:14:54 +0200 [thread overview]
Message-ID: <4DBA818E.6040501@kpanic.de> (raw)
In-Reply-To: <4DB98D13.1050107@kpanic.de>
On 28.04.2011 17:51, Stefan Assmann wrote:
> On 04/28/2011 05:08 PM, Andi Kleen wrote:
>>> You're right, logging every page marked would be too verbose. That's why
>>> I wrapped that logging into pr_debug.
>>
>> pr_debug still floods the kernel log buffer. On large systems
>> it often already overflows.
>
> That's a pain then, I understand.
I took a closer look at pr_debug and it seems that pr_debug gets
evaluated to a conditional branch and thus does not flood the log buffer
if not explicitly enabled. I confirmed that by dumping the log buffer.
So in the normal use-case things should be fine and if pr_debug really
is enabled it dumps a lot of data, which I hope is acceptable for
debugging purposes.
>
>>
>>> However I kept the printk in the case of early allocated pages. The user
>>> should be notified of the attempt to mark a page that's already been
>>> allocated by the kernel itself.
>>
>> That's ok, although if you're unlucky (e.g. hit a large mem_map area)
>> it can be also very nosiy.
>>
>> It would be better if you fixed the printks to output ranges.
>
> BadRAM patterns might often mark non-consecutive pages so outputting
> ranges could be more verbose than what we have now. I'll try to think
> of something to minimize log output.
How about the following:
static int __init badram_mark_pages(unsigned long addr, unsigned long mask)
{
unsigned long pagecount = 0, is_reserved = 0;
[...]
printk(KERN_INFO "BadRAM: mark 0x%lx with mask 0x%0lx\n", addr, mask);
do {
[...]
if (memblock_is_reserved(addr)) {
pr_debug("BadRAM: page %lu reserved by kernel\n", pfn);
is_reserved++;
continue;
}
[...]
pr_debug("BadRAM: page %lu (addr 0x%0lx) marked bad "
"[total %lu]\n", pfn, addr, pagecount);
} while (next_masked_address(&addr, mask));
if (is_reserved)
printk(KERN_WARNING "BadRAM: %lu page(s) already reserved and "
"could not be marked bad\n", is_reserved);
return pagecount;
}
This way everything with possibly high volume log output is guarded by
pr_debug and only the summary gets printed by default. No log_buf
cluttering but also a bit harder to debug for somebody who's interested
in finding out which pages are already reserved.
Stefan
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-04-29 9:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 16:16 [RFC PATCH 0/3] support for broken memory modules (BadRAM) Stefan Assmann
2011-04-27 16:16 ` [RFC PATCH 1/3] Add string parsing function get_next_ulong Stefan Assmann
2011-04-27 16:28 ` Randy Dunlap
2011-04-27 16:16 ` [RFC PATCH 2/3] support for broken memory modules (BadRAM) Stefan Assmann
2011-04-27 21:12 ` Andi Kleen
2011-04-28 6:34 ` Stefan Assmann
2011-04-28 15:08 ` Andi Kleen
2011-04-28 15:51 ` Stefan Assmann
2011-04-28 17:44 ` Luck, Tony
2011-04-29 9:14 ` Stefan Assmann [this message]
2011-04-27 16:16 ` [RFC PATCH 3/3] Add documentation and credits for BadRAM Stefan Assmann
2011-04-27 16:49 ` Randy Dunlap
2011-04-27 20:05 ` Stefan Assmann
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=4DBA818E.6040501@kpanic.de \
--to=sassmann@kpanic.de \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=hpa@zytor.com \
--cc=linux-mm@kvack.org \
--cc=lwoodman@redhat.com \
--cc=mingo@elte.hu \
--cc=rick@vanrein.org \
--cc=riel@redhat.com \
--cc=tony.luck@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).