lkml.org 
[lkml]   [2004]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] memory defragmentation to satisfy high order allocations

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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [from the cache]
©2003-2011 Jasper Spaans