]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix the last known race in swapoff(), which could lead to a spurious panic:
authordas <das@FreeBSD.org>
Sat, 6 Nov 2004 07:17:50 +0000 (07:17 +0000)
committerdas <das@FreeBSD.org>
Sat, 6 Nov 2004 07:17:50 +0000 (07:17 +0000)
commit9d935df169273c60c7362e63fe5d98bc85e23d8b
treef606cc223b6da16a09340e1d6c06212f6dac31be
parent8bc275db5e700002108ad80bc1c460cbe85457bb
Fix the last known race in swapoff(), which could lead to a spurious panic:

swapoff: failed to locate %d swap blocks

The race occurred because putpages() can block between the time it
allocates swap space and the time it updates the swap metadata to
associate that space with a vm_object, so swapoff() would complain
about the temporary inconsistency.  I hoped to fix this by making
swp_pager_getswapspace() and swp_pager_meta_build() a single atomic
operation, but that proved to be inconvenient.  With this change,
swapoff() simply doesn't attempt to be so clever about detecting when
all the pageout activity to the target device should have drained.
sys/vm/swap_pager.c