lkml.org 
[lkml]   [2012]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Weirdness in __alloc_bootmem_node_high
On Fri, Apr 20, 2012 at 11:29:07AM -0700, Tejun Heo wrote:
> On Tue, Apr 17, 2012 at 05:55:02PM +0200, Michal Hocko wrote:
> > Hi,
> > I just come across the following condition in __alloc_bootmem_node_high
> > which I have hard times to understand. I guess it is a bug and we need
> > something like the following. But, to be honest, I have no idea why we
> > care about those 128MB above MAX_DMA32_PFN.
> > ---
> > mm/bootmem.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mm/bootmem.c b/mm/bootmem.c
> > index 0131170..5adb072 100644
> > --- a/mm/bootmem.c
> > +++ b/mm/bootmem.c
> > @@ -737,7 +737,7 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
> > /* update goal according ...MAX_DMA32_PFN */
> > end_pfn = pgdat->node_start_pfn + pgdat->node_spanned_pages;
> >
> > - if (end_pfn > MAX_DMA32_PFN + (128 >> (20 - PAGE_SHIFT)) &&
> > + if (end_pfn > MAX_DMA32_PFN + (128 << (20 - PAGE_SHIFT)) &&
> > (goal >> PAGE_SHIFT) < MAX_DMA32_PFN) {
> > void *ptr;
> > unsigned long new_goal;
>
> Regardless of x86 not using it, this is a bug fix and this code path
> seems to be used by mips at least.

I took a quick look at this.
__alloc_bootmem_node_high() is used in mm/sparse.c - but only
if SPARSEMEM_VMEMMAP is enabled.

mips has this:

config ARCH_SPARSEMEM_ENABLE
bool
select SPARSEMEM_STATIC

So SPARSEMEM_VMEMMAP is not enabled.

__alloc_bootmem_node_high() is used in mm/sparse-vmemmap.c which
also depends on CONFIG_SPARSEMEM_VMEMMAP.


So I really do not see the logic in __alloc_bootmem_node_high()
being used anymore and it can be replaced by __alloc_bootmem_node()

Sam


\
 
 \ /
  Last update: 2012-04-20 21:17    [W:1.775 / U:1.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site