From: Sonny Rao <sonny@burdell.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@osdl.org>, Paul Jackson <pj@sgi.com>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
ak@suse.com
Subject: Re: Fw: 2.6.16 crashes when running numastat on p575
Date: Mon, 3 Apr 2006 04:09:50 -0400 [thread overview]
Message-ID: <20060403080950.GA2993@kevlar.burdell.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0604022149450.15895@schroedinger.engr.sgi.com>
On Sun, Apr 02, 2006 at 10:12:29PM -0700, Christoph Lameter wrote:
> On Sun, 2 Apr 2006, Andrew Morton wrote:
>
> > I have a vague feeling that you guys worked on numastat?
>
> This is mostly Andi's code although I added the zone_pcp() stuff. This is
> failing because zone_pcp() only returns valid information for online
> processors.
>
> Initially all zone_pcps() point to the boot_cpuset (see zone_pcp_init)
> and therefore zone_pcp) is always valid and we do not see this bug. But
> if someone downs a processor or a processor dies then free_zone_pageset()
> is called which will set zone_pcp() = NULL.
>
>
> Fix NULL pointer dereference in node_read_numastat()
>
> zone_pcp() only returns valid values if the processor is online.
>
> Change node_read_numastat() to only scan online processors.
>
> Signed-off-by: Christoph Lameter <clameter@sgi.com>
>
> Index: linux-2.6.16/drivers/base/node.c
> ===================================================================
> --- linux-2.6.16.orig/drivers/base/node.c 2006-03-19 21:53:29.000000000 -0800
> +++ linux-2.6.16/drivers/base/node.c 2006-04-02 21:59:49.000000000 -0700
> @@ -106,7 +106,7 @@ static ssize_t node_read_numastat(struct
> other_node = 0;
> for (i = 0; i < MAX_NR_ZONES; i++) {
> struct zone *z = &pg->node_zones[i];
> - for (cpu = 0; cpu < NR_CPUS; cpu++) {
> + for_each_online_cpu(cpu) {
> struct per_cpu_pageset *ps = zone_pcp(z,cpu);
> numa_hit += ps->numa_hit;
> numa_miss += ps->numa_miss;
Works, thanks.
Sonny
prev parent reply other threads:[~2006-04-03 8:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060402213216.2e61b74e.akpm@osdl.org>
2006-04-03 5:12 ` Fw: 2.6.16 crashes when running numastat on p575 Christoph Lameter
2006-04-03 5:15 ` Paul Jackson
2006-04-03 5:25 ` Christoph Lameter
2006-04-03 6:43 ` Paul Jackson
2006-04-03 14:10 ` Nathan Lynch
2006-04-03 17:42 ` Christoph Lameter
2006-04-03 18:01 ` Nathan Lynch
2006-04-03 18:08 ` Christoph Lameter
2006-04-03 21:18 ` Andrew Morton
2006-04-04 0:25 ` Paul Jackson
2006-04-03 11:49 ` Andi Kleen
2006-04-03 14:18 ` Nathan Lynch
2006-04-03 8:09 ` Sonny Rao [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=20060403080950.GA2993@kevlar.burdell.org \
--to=sonny@burdell.org \
--cc=ak@suse.com \
--cc=akpm@osdl.org \
--cc=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=pj@sgi.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).