Re: [MODSLAB 3/7] A Kmalloc subsystem

From: KAMEZAWA Hiroyuki
Date: Fri Aug 18 2006 - 14:18:12 EST


On Fri, 18 Aug 2006 09:58:13 -0700 (PDT)
Christoph Lameter <clameter@xxxxxxx> wrote:

> On Fri, 18 Aug 2006, KAMEZAWA Hiroyuki wrote:
>
> > Just a note: with SPARSEMEM, we need more calculation and access to
> > mem_section[] table and page structs(mem_map).
>
> Uhh, a regression against DISCONTIG. Could you address that issue?
>
At first, ia64's DISCONTIG is special because of VIRTUAL_MEMMAP.
and ia64's SPARSEMEM is special,too. it's SPARSEMEM_EXTREME.


Considering generic arch, see include/asm-generic/memory_model.h,
which doesn't use virtual mem_map.

with FLATMEM, pfn_to_page() is pfn + mem_map. just an address calclation.

with *usual* DISCONTIG
--
pgdat = NODE_DATA(pfn_to_nid(pfn));
page = pgdat->node_mem_map + pfn - pgdat->node_start_pfn
--
if accessing to pgdat is fast, cost will not be big problem.
pfn_to_nid() is usually implemeted by calclation or table look up.

and usual SPARSEMEM, (not EXTREME)
--
page = mem_section[(pfn >> SECTION_SHIFT)].mem_map + pfn
--
need one table look up. maybe not very big.

with SPARSEMEM_EXTREME
--
page = mem_section[(pfn >> SECTION_SHIFT)][(pfn & MASK)].mem_map + pfn
--
need one (big)table look up.


-Kame

-
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/