Re: [Approach #2] [RFC][PATCH] Remove cgroup member from struct page

From: Balbir Singh
Date: Wed Sep 10 2008 - 18:37:43 EST


Dave Hansen wrote:
> On Tue, 2008-09-09 at 18:20 -0700, Balbir Singh wrote:
>> + start = pgdat->node_start_pfn;
>> + end = pgdat->node_start_pfn + pgdat->node_spanned_pages;
>> + size = (end - start) * sizeof(struct page_cgroup);
>> + printk("Allocating %lu bytes for node %d\n", size, n);
>> + pcg_map[n] = alloc_bootmem_node(pgdat, size);
>> + /*
>> + * We can do smoother recovery
>> + */
>> + BUG_ON(!pcg_map[n]);
>> + return 0;
>> }
>
> This will really suck for sparse memory machines. Imagine a machine
> with 1GB of memory at 0x0 and another 1GB of memory at 1TB up in the
> address space.
>

I would hate to re-implement the entire sparsemem code :(
Kame did suggest making the memory controller depend on sparsemem (to hook in
from there for allocations)

> You also need to consider how it works with memory hotplug and how
> you're going to grow it at runtime.
>

Yes, true. This is not the final version, a very very early version that I
posted for initial comments.

> Oh, and doesn't alloc_bootmem() panic() if it fails internally anyway?
>
> I need to look at your other approach. :)

We'll need some slab_is_available() sort of checks that sparse.c uses and also
deal with memory hotplug add and remove.

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