[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1232584180.27278.86.camel@nimitz>
Date: Wed, 21 Jan 2009 16:29:39 -0800
From: Dave Hansen <dave@...ux.vnet.ibm.com>
To: Chandru <chandru@...ibm.com>
Cc: Paul Mackerras <paulus@...ba.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linuxppc-dev@...abs.org,
Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: Re: 2.6.28-rc9 panics with crashkernel=256M while booting
On Mon, 2009-01-19 at 17:00 +0530, Chandru wrote:
> --- linux-2.6.29-rc2/arch/powerpc/mm/numa.c.orig 2009-01-19 16:14:49.000000000 +0530
> +++ linux-2.6.29-rc2/arch/powerpc/mm/numa.c 2009-01-19 16:36:38.000000000 +0530
> @@ -901,7 +901,8 @@ static void mark_reserved_regions_for_ni
> get_node_active_region(start_pfn, &node_ar);
> while (start_pfn < end_pfn &&
> node_ar.start_pfn < node_ar.end_pfn) {
> - unsigned long reserve_size = size;
> + unsigned long reserve_size = (size >> PAGE_SHIFT) <<
> + PAGE_SHIFT;
> /*
> * if reserved region extends past active region
> * then trim size to active region
> @@ -917,7 +918,8 @@ static void mark_reserved_regions_for_ni
> dbg("reserve_bootmem %lx %lx nid=%d\n",
> physbase, reserve_size, node_ar.nid);
> reserve_bootmem_node(NODE_DATA(node_ar.nid),
> - physbase, reserve_size,
> + (start_pfn << PAGE_SHIFT),
> + reserve_size,
> BOOTMEM_DEFAULT);
> }
> /*
Chandru, I don't mean to keep ragging on your patches, but I really
don't think this is right, yet.
Let's take, for instance, a 1-byte reservation. With this code, you've
suddenly turned that into a 0-byte reservation, and that *can't* be
right. The same thing happens if you have a reservation that spans two
pages. If you unconditionally round it down, then you might miss the
part that spans a portion of the second page.
It needs to be rounded down like you are suggesting here, but only in
the case where we've gone over the *CURRENT* node's boundary. This is
kinda what that "if (end_pfn > node_ar.end_pfn)" check is doing. But,
it evidently screws it up if the overlap isn't by an entire page or
something.
Please also, for pete's sake, use masks (a la PAGE_MASK) or macros if
you're going to page-align something. Don't shift down and up like
that.
-- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists