[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48C4A0FF.8070705@gmail.com>
Date: Mon, 08 Sep 2008 11:50:23 +0800
From: Li Yu <raise.sail@...il.com>
To: hamid.jahanjou@...il.com
CC: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] VM: Implements the swap-out page-clustering technique
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@...il.com>
> [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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists