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

Christoph Lameter
2005-10-19T15:29:37Z

On Wed, 19 Oct 2005, Magnus Damm wrote:

> I'm trying to figure out if this code works in all cases:
>
> + spin_lock_irq(&zone->lru_lock);
> + list_del(&page->lru);
> + if (!TestSetPageLRU(page)) {
> + if (PageActive(page))
> + add_page_to_active_list(zone, page);
> + else
> + add_page_to_inactive_list(zone, page);
> + count++;
> + }
> + spin_unlock_irq(&zone->lru_lock);
>
> Why not use if (TestSetPageLRU(page)) BUG()?

That is probably right.