Re: [RFC] memory defragmentation to satisfy high order allocations

From: Hiroyuki KAMEZAWA
Date: Sun Oct 03 2004 - 21:34:34 EST



how about inserting this if-sentense ?

-- Kame

Marcelo Tosatti wrote:
+int coalesce_memory(unsigned int order, struct zone *zone)
+{
<snip>

+ while (entry != &area->free_list) {
+ int ret;
+ page = list_entry(entry, struct page, lru);
+ entry = entry->next;
+

+ if (((page_to_pfn(page) - zone->zone_start_pfn) & (1 << toorder)) {

+ pwalk = page;
+
+ /* Look backwards */
+
+ for (walkcount = 1; walkcount<nr_pages; walkcount++) {
..................
+ }
+
+ } else {
+forward:
+
+ pwalk = page;
+
+ /* Look forward, skipping the page frames from this + high order page we are looking at */
+
+ for (walkcount = (1UL << torder); walkcount<nr_pages; + walkcount++) {
+ pwalk = page+walkcount;
+
+ ret = can_move_page(pwalk);
+
+ if (ret) + nr_freed_pages++;
+ else
+ goto loopey;
+
+ if (nr_freed_pages == nr_pages)
+ goto success;
+ }
+
+ }

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