Re: minor patch for 2.1.103 swap

Stephen C. Tweedie (sct@dcs.ed.ac.uk)
Sun, 24 May 1998 18:32:28 +0100


Hi,

On Sat, 23 May 1998 10:09:26 -0400, Bill Hawes <whawes@star.net> said:

> In the free_page() routines there is a panic if a swap cache page has
> a ref count of 1, but according to code and comments elsewhere this
> shouldn't be a problem. Shrink_mmap has a test to remove pages from
> the swap cache when count == 1, and a comment in vmscan.c states that
> a page might occasionally be left in the swap cache after having other
> references freed. Since these cases would all come through free_page()
> with the count set to 1, there's no longer any reason to cause a
> panic. (And possibly the warning should be removed as well at some
> point.)

The swap cache code is careful always to clear the swap cache bit on a
page before doing the final __free_page(). If we get to __free_page()
with the swap cache bit still set, then it is definitely an unexpected
event. Yes, we can free swap cache pages with a reference count of
one, but __free_page() should never see the bit set.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu