Re: [PATCH] mm/memory.c, 2.4.1 : memory leak with swap cache (updated)

Linus Torvalds (torvalds@transmeta.com)
27 Mar 2001 13:51:58 -0800


On Tue, 27 Mar 2001, Richard Jerrell wrote:
>
> Instead of removing the swap cache page at process exit and possibly
> expending time doing disk IO as you have pointed out, we check during
> refill_inactive_scan and page_launder for a page that is

I think this patch looks pretty good. However, I don't think you can
safely do a "is_shared()" query without holding the page lock.

I'd be happy to be shown otherwise, of course. I'm just generally very
wary of "is_shared()", and that function makes me nervous. I'd almost
prefer to get rid of it, and test for the stuff it tests for directly
(most places that test this are likely to not need all the tests
anyway).

I also have this suspicion that most of the advantage of this patch
could easily be gotten by just testing for the exclusive "no longer
used" case in the swap-cache "writepage()" function. That would have
the advantage of localizing the test more, and minimizing special-case
swap-cache tests in the general VM codepaths.

Comments?

Linus

-
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/