Re: [PATCH] Fix crash with FLAT_MEMORY and ARCH_PFN_OFFSET != 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 18, 2007 at 04:24:04AM -0800, Andrew Morton wrote:
> On Tue, 18 Dec 2007 13:03:00 +0100 (CET) Thomas Bogendoerfer <[email protected]> wrote:
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -3427,7 +3427,7 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
> >  		mem_map = NODE_DATA(0)->node_mem_map;
> >  #ifdef CONFIG_ARCH_POPULATES_NODE_MAP
> >  		if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
> > -			mem_map -= pgdat->node_start_pfn;
> > +			mem_map -= (pgdat->node_start_pfn - ARCH_PFN_OFFSET);
> >  #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
> >  	}
> >  #endif
> 
> hm.  It's rather non-trivial to verify that this will compile OK on all
> architectures.

I grepped through include/asm-* and found:

#if defined(CONFIG_FLATMEM)

#ifndef ARCH_PFN_OFFSET
#define ARCH_PFN_OFFSET         (0UL)
#endif

in include/asm-generic/memory_model.h. So I'm still confident, that
this works on all architectures. It's tested on MIPS.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux