Re: [PATCH 3/4] reuse unused swap entry if necessary

Balbir Singh
2009-05-30T06:40:54Z

* KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2009-05-28 14:20:47]:

> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
> Now, we can know a swap entry is just used as SwapCache via swap_map,
> without looking up swap cache.
>
> Then, we have a chance to reuse swap-cache-only swap entries in
> get_swap_pages().
>
> This patch tries to free swap-cache-only swap entries if swap is
> not enough.
> Note: We hit following path when swap_cluster code cannot find
> a free cluster. Then, vm_swap_full() is not only condition to allow
> the kernel to reclaim unused swap.
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

Looks good, except the now changed behaviour where swap will get
distributed between clusters. Having the vm_swap_full() is a good
optimization for swap allocation performance though. I'd say lets wait
to see the results of testing

Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>

--
Balbir