Re: [PATCH 1/2] Page migration via Swap V2: Page Eviction

Christoph Lameter
2005-10-18T16:43:39Z

On Tue, 18 Oct 2005, Magnus Damm wrote:

> This function is very similar to isolate_lru_pages(), except that it
> operates on one page at a time and drains the lru if needed. Maybe
> isolate_lru_pages() could use this function (inline) if the spinlock
> and drain code was moved out?

isolate_lru_pages operates on batches of pages from the same zone and is
very efficient by only taking a single lock. It also does not drain other
processors LRUs.

> I'm also curios why you choose to always use list_del() and move back
> the page if freed elsewhere, instead of using
> del_page_from_[in]active_list(). I guess because of performance. But
> if that is the case, wouldn't it make sense to do as little as
> possible with the spinlock held, ie move list_add() (when rc == 1) out
> of the function?

I tried to follow isolate_lru_pages as closely as possible. list_add() is
a simple operation and so I left it inside following some earlier code
from the hotplug project.