Re: SwapCache bug?

Mark Hemment (markhe@sco.COM)
Mon, 5 Apr 1999 13:57:45 +0100 (BST)


> > Also in do_wp_page(), what happens to a swap-cached page whose reference
> > count is greater than 2? There looks like a missing default case which
> > does a swap_free().
> No, that is very much deliberate: there may well be other processes
> around which still refer to the copy on disk, so we want to do a COW and
> keep the swap cache copy present. (This catches the case of a
> partially-swapped-out process which keeps forking: if one child swaps a
> page in, then we do a COW and the next child to access that page will
> find its copy already in cache.)

I agree there maybe other processes around which refer to the disk copy,
but isn't there a need to decrement the reference count for this disk
copy on a COW? ie. do a swap_free() when the page ref count is greater
than 2 - not to free the disk-copy, but to keep the swap_map counter


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at