lkml.org 
[lkml]   [2002]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] swap 1/4 swapon memleak
Burton reported Kernel memory leak with swapon/swapoff? LKML 31 May.
swapon uses rw_swap_page_nolock to read swap_header page (peculiar!
should probably rework that sometime), nothing freed the buffers
from the page, and thus the page was also never freed.

--- 2.4.19-pre10/mm/page_io.c Mon Nov 19 23:19:42 2001
+++ linux/mm/page_io.c Tue Jun 11 19:02:30 2002
@@ -120,8 +120,10 @@
PAGE_BUG(page);
/* needs sync_page to wait I/O completation */
page->mapping = &swapper_space;
- if (!rw_swap_page_base(rw, entry, page))
- UnlockPage(page);
- wait_on_page(page);
+ if (rw_swap_page_base(rw, entry, page))
+ lock_page(page);
+ if (!block_flushpage(page, 0))
+ PAGE_BUG(page);
page->mapping = NULL;
+ UnlockPage(page);
}
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.052 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site