Re: Locking issue on try_to_swap_out()
From: Rik van Riel <hidden>
Date: 2001-01-17 07:13:46
On Sun, 14 Jan 2001, Marcelo Tosatti wrote:
quoted hunk ↗ jump to hunk
In theory, there is nothing which guarantees that nobody will mess with the page between "UnlockPage" and "deactivate_page" (that is pretty hard to happen, I suppose, but anyway)--- mm/vmscan.c.orig Sun Jan 14 13:23:55 2001 +++ mm/vmscan.c Sun Jan 14 13:24:16 2001@@ -72,10 +72,10 @@ swap_duplicate(entry); set_pte(page_table, swp_entry_to_pte(entry)); drop_pte: - UnlockPage(page); mm->rss--; if (!page->age) deactivate_page(page); + UnlockPage(page); page_cache_release(page); return; }
Why do you suppose the page_cache_release(page) is BELOW the deactivate_page(page) call ? We are still holding a reference on the page when we call deactivate_page(page), this is what keeps the page from going away from under us. regards, Rik -- Virtual memory is like a game you can't win; However, without VM there's truly nothing to lose... http://www.surriel.com/ http://www.conectiva.com/ http://distro.conectiva.com.br/ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/