Re: [PATCH] mm: fix boundary checking in free_bootmem_core

From: Yinghai Lu
Date: Wed Mar 12 2008 - 21:12:15 EST


On Wed, Mar 12, 2008 at 4:33 PM, Andrew Morton
<akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, 12 Mar 2008 16:21:22 -0700
>
>
> "Yinghai Lu" <yhlu.kernel@xxxxxxxxx> wrote:
>
> > On Tue, Mar 11, 2008 at 6:01 PM, Yinghai Lu <yhlu.kernel@xxxxxxxxx> wrote:
> > > [PATCH] mm: fix boundary checking in free_bootmem_core
> > >
> > > so call it when numa is enabled, we don't know which node have that range.
> > > and make it more robust.
> > >
> > > try to trim it to get valid sidx, and eidx.
> > >
> > > Signed-off-by: Yinghai Lu <yhlu.kernel@xxxxxxxxx>
> > >
> >
> > Ingo,
> >
> > this one need to be applied before
> > [PATCH] x86_64: reserve dma32 early for gart
> >
>
> So perhaps we should merge
> mm-fix-boundary-checking-in-free_bootmem_core.patch into 2.6.25?
also we can remove some NODE_DATA(0) assumpation on free_bootmem path.
>
> <looks at it>
>
> Sorry, but I find the changelog very hard to amke sense of. I presently
> have:
>
>
> So call it when numa is enabled, we don't know which node have that
> range. and make it more robust.
>
> Try to trim it to get valid sidx, and eidx.
>
> Could you please expand on this?

please check following...

---
with numa enabled, some caller could have range on one node but try to
free that on other node.
that could cause some pages is freed wrongly.
For example: when we try to allocate 128g boot ram early for
gart/swiotlb, and free that range later so gart/swiotlb could get some
range afterwards. then with this patch, we don't need to care which
node is the range, just loop to call free_bootmem_node for all online
nodes.

this patch make free_bootmem_core more robust by trim the sidx and
eidx according the ram range that
node have.

----
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/