2001-02-16 22:18:55

by Richard Jerrell

[permalink] [raw]
Subject: [PATCH] mm/memory.c, 2.4.1 : memory leak with swap cache

2.4.1 has a memory leak (temporary) where anonymous memory pages that have
been moved into the swap cache will stick around after their vma has been
unmapped by the owning process. These pages are not free'd in free_pte()
because they are still referenced by the page cache. In addition, if the
pages are dirty, they will be written out to the swap device before they
are reclaimed even though the owning process no longer will be using the
pages.

free_pte in mm/memory.c has been modified to check to see if the page is
only being referenced by the swap cache (and possibly buffers). If so,
the buffers (if existant) are free'd and the page and swap cache
entry are removed immediately.

Rich Jerrell
[email protected]


Attachments:
2.4.1-paging-fix-15.02.01.patch (1.38 kB)