Re: [PATCH] VM: Implements the swap-out page-clustering technique

From: Li Yu
Date: Sun Sep 07 2008 - 23:50:45 EST


Hamid R. Jahanjou åé:
From: Hamid R. Jahanjou

Implements the idea of swap-out page clustering from *BSD for
Linux. Each time a candidate page is to be swapped out,
virtually-nearby pages are scanned to find eligible pages to be
swapped out too as a cluster. This technique increases the likelihood of
bringing in related data on a page fault and decreases swap space
fragmentation in the long run. Currently, Linux searches only
physically-nearby pages which is not optimal since, over time, physically-
adjacent pages may become unrelated.

The code can be statically tuned. No benchmarks. I'm not sure whether
the added complexity is acceptable.

Signed-off-by: Hamid R. Jahanjou <hamid.jahanjou@xxxxxxxxx>
[snip a lot of code here]
+
+ for(vm_address = cursor_vma->vm_start; + vm_address < cursor_vma->vm_end && ci->nr_collected < ci->cluster_size; + vm_address += PAGE_SIZE)
+ {
+ cursor_page = virt_to_page(vm_address);

I do not think that the virt_to_page() can work well on userland virtual address space.
And the linear searching for whole address space of a vma is not good idea too, really.

+ if (!page_allowed_in_cluster(cursor_page, ci))
+ continue;


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