Re: [PATCH] ARM: Fix page counting in mem_init and show_mem

2012-11-29 Thread Michael Spang
On Thu, Nov 29, 2012 at 8:08 AM, Russell King - ARM Linux wrote: > On Mon, Oct 22, 2012 at 09:34:51PM -0400, Michael Spang wrote: >> for_each_bank (i, mi) { >> struct membank *bank = &mi->bank[i]; >> - unsigned int pfn1, pfn2; >> - struct page *page, *en

Re: [PATCH] ARM: Fix page counting in mem_init and show_mem

2012-11-29 Thread Russell King - ARM Linux
On Mon, Oct 22, 2012 at 09:34:51PM -0400, Michael Spang wrote: > for_each_bank (i, mi) { > struct membank *bank = &mi->bank[i]; > - unsigned int pfn1, pfn2; > - struct page *page, *end; > + unsigned int start, end, pfn; > > - pfn

[PATCH] ARM: Fix page counting in mem_init and show_mem

2012-10-22 Thread Michael Spang
The code in mem_init & show_mem to count page usage has two issues: 1. It assumes the memory map for a bank is contiguous. The sparsemem memory model partitions the memory map into sections, which may not be contiguous. They are usually contiguous due only to allocation order. Avoid this