Re: [RFC] virtual memmap for sparsemem [1/2] arch independent part

From: Heiko Carstens <>
Date: 2006-11-21 22:37:08
On Thu, Oct 19, 2006 at 05:21:40PM +0900, KAMEZAWA Hiroyuki wrote:
> This is a patch for virtual memmap on sparsemem against 2.6.19-rc2.
> booted well on my Tiger4.
> In this time, this is just a RFC. comments on patch and advises for benchmarking
> is welcome. (memory hotplug case is not well handled yet.)
> ia64's SPARSEMEM uses SPARSEMEM_EXTREME. This requires 2-level table lookup by
> software for page_to_pfn()/pfn_to_page(). virtual memmap can remove that costs.
> But will consume more TLBs.
> For make patches simple, pfn_valid() uses sparsemem's logic. 
> - Kame
> ==
> This patch maps sparsemem's *sparse* memmap into contiguous virtual address range
> starting from virt_memmap_start.
> By this, pfn_to_page, page_to_pfn can be implemented as 
> #define pfn_to_page(pfn)		(virt_memmap_start + (pfn))
> #define page_to_pfn(pg)			(pg - virt_memmap_start)
> Difference from ia64's VIRTUAL_MEMMAP are
> * pfn_valid() uses sparsemem's logic.
> * memmap is allocated per SECTION_SIZE, so there will be some of RESERVED pages.
> * no holes in MAX_ORDER range. so HOLE_IN_ZONE=n here.
> Todo
> - fix vmalloc() case in memory hotadd. (maybe __get_vm_area() can be used.)

Better late than never, but here is a reply as well :)

Is this supposed to replace ia64's vmem_map?
I'm asking because on s390 we need a vmem_map too, but don't want to be
limited by the sparsemem restrictions (especially SECTION_SIZE that is).
In addition we have a shared memory device driver (dcss) with which it
is possible to attach some shared memory. Because of that it is
necessary to be able to add some additional struct pages on-the-fly.
This is not very different to memory hotplug; I think it's even easier,
since all we need are some initialized struct pages.

Currently I have a working prototype that does all that but still needs
a lot of cleanup and some error handling. It is (of course) heavily
inspired by ia64's vmem_map implementation.

I'd love to go for a generic implementation, but if that is based on
sparsemem it doesn't make too much sense on s390.
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Tue Nov 21 22:39:46 2006

This archive was generated by hypermail 2.1.8 : 2006-11-21 22:40:03 EST