Re: pre12 VM doubts and patch

Hugh Dickins (hugh@veritas.com)
Wed, 19 Sep 2001 20:42:39 +0100 (BST)


On Wed, 19 Sep 2001, Hugh Dickins wrote:
>
> thank you. A few doubts: in the first case I've appended a patch; for
> the rest you may prefer to make your own patch, or ask me for patch,
> or reject my doubts.

Please add another:

6. Why has swap_writepage lost its check for stale entries? If your
other changes have somehow made that too rare a case to bother
about, please remove the comment above swap_writepage instead.

Hugh

--- 2.4.10-pre12/mm/swap_state.c Wed Sep 19 14:05:54 2001
+++ linux/mm/swap_state.c Mon Sep 17 06:30:26 2001
@@ -23,6 +23,17 @@
*/
static int swap_writepage(struct page *page)
{
+ /* One for the page cache, one for this user, one for page->buffers */
+ if (page_count(page) > 2 + !!page->buffers)
+ goto in_use;
+ if (swap_count(page) > 1)
+ goto in_use;
+
+ delete_from_swap_cache_nolock(page);
+ UnlockPage(page);
+ return 0;
+
+in_use:
rw_swap_page(WRITE, page);
return 0;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/