Re: [Lhms-devel] [RFC/PATCH: 002/010] Memory hotplug for new nodeswith pgdat allocation. (Wait table and zonelists initalization)

From: KAMEZAWA Hiroyuki
Date: Tue Feb 14 2006 - 20:04:27 EST


Yasunori Goto wrote:
+ if (system_state == SYSTEM_RUNNING){
+ unsigned long queue_head_size = 1;
+ while (queue_head_size < sizeof(wait_queue_head_t))
+ queue_head_size <<= 1;
+
+ pages = (1 << (PAGE_SHIFT + 3)) / queue_head_size;
+ }
+
we have to kmalloc() wait_table after this.
I don't think we always succeed to alloc multiple contiguous pages by kmalloc().
How about allocating wait_table like this ?
==
size = 4096; /* 4096 is maximum size */
while(size) {
waittable = kmalloc(size * sizeof(wait_queue_head_t), GFP_KERNEL):
if (wait_table)
break;
size = size >> 1;
}
zone->wait_table_size = size;
zone->wait_table_bits = wait_table_bits(zone->wait_table_size);
zone->wait_table = wait_table;
==


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