From: Jason Baron <jbaron@redhat.com>
To: linux-ia64@vger.kernel.org
Subject: Re: show_mem panics in 2.4.22
Date: Tue, 28 Oct 2003 16:45:25 +0000 [thread overview]
Message-ID: <marc-linux-ia64-106735996431447@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-106731898417513@msgid-missing>
On Tue, 28 Oct 2003, John Marvin wrote:
> > I'm running linux-2.4.22-ia64-030909 on an rx2600. The show_mem()
> > function always causes a kernel panic. This is reached when you send
> > 'SysRq m' or serial 'BREAK m' to find out about used memory, etc.
> >
> > The problem seems to be that this function is written assuming that
> > the discontiguous memory scheme is used, but that's not the case in my
> > configuration. I see that in 2.6.0-test8 there are two versions of
> > the function for the contig/discontig cases. The crash is on the line
> > that reads through pgdat->node_mem_map. I'm not sure exactly what is
> > wrong with that.
>
>
> I'm not sure why this just started to show up. The problem is that
> the size of struct page doesn't divide into the page size evenly, so
> the structure overlaps holes in the mem_map array. Here is a fix,
> but I am still not sure of the performance implications (extra memory
> dereference). There may be a better fix, although not as simple, if
> this has performance implications.
>
> The same bug probably exists in 2.6.
>
> John Marvin
> jsm@fc.hp.com
>
>
> --- a/arch/ia64/mm/init.c Tue Oct 28 01:25:54 2003
> +++ b/arch/ia64/mm/init.c Tue Oct 28 01:31:26 2003
> @@ -485,7 +485,8 @@ ia64_page_valid (struct page *page)
> {
> char byte;
>
> - return __get_user(byte, (char *) page) = 0;
> + return (__get_user(byte, (char *) page) = 0)
> + && (__get_user(byte, (char *) (page + 1) - 1) = 0);
> }
>
> #define GRANULEROUNDDOWN(n) ((n) & ~(IA64_GRANULE_SIZE-1))
> -
> To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
The count in show_mem() is not quite accurate, since we might count page
structures that are mapped to valid memory, but are zero filled and do not
correspond to valid memory. show_mem() will no longer oops, though. Since
ia64_page_valid, could be on several hot paths, we might just want to
restrict this check to the show_mem() function. This could have just
cropped up, if struct page had changed in size.
-Jason
next prev parent reply other threads:[~2003-10-28 16:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-28 5:29 show_mem panics in 2.4.22 Martin Pool
2003-10-28 8:45 ` John Marvin
2003-10-28 16:45 ` Jason Baron [this message]
2003-10-29 3:42 ` Martin Pool
2003-10-29 6:22 ` Martin Pool
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=marc-linux-ia64-106735996431447@msgid-missing \
--to=jbaron@redhat.com \
--cc=linux-ia64@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox