Re: SwapCache bug?

Stephen C. Tweedie (sct@redhat.com)
Mon, 5 Apr 1999 15:01:00 +0100 (BST)


Hi,

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

> 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
> correct.

Not in do_wp_page(): that is only used for physically present pages, so
the pte we are touching doesn't count as a swap entry in the first
place. A write fault to a swap-entry pte will go from
handle_pte_fault() via do_swap_page() into swap_in(), and there we _do_
perform a swap_free where necessary.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/