kernel - Fix swap space leak
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 27 Dec 2011 22:15:50 +0000 (14:15 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 27 Dec 2011 22:15:50 +0000 (14:15 -0800)
commit0301c407992b4e73ffebb89e08bfc1efe3c4bec6
tree2d0c17ec9525f87e9d7e261ae36c1465748a033b
parentd7f53ae9b6a55bc932e1892eb0d5838aae3f3282
kernel - Fix swap space leak

* swp_pager_meta_free_callback() had a bug where the last swap block
  in the swblock{} structure was not being freed from the swap bitmap.

* Also fix two rare race conditions.  swp_pager_freeswapspace() can
  block, causing the VM object token to be temporarily unlocked.  Deal
  with the race by not decrementing the swb_count field until after
  swp_pager_freeswapspace() is called.

Reported-by: sephe
sys/vm/swap_pager.c