Do not delegate a work to geom event thread which can be done inline.
authorkib <kib@FreeBSD.org>
Thu, 28 Jul 2016 15:57:01 +0000 (15:57 +0000)
committerkib <kib@FreeBSD.org>
Thu, 28 Jul 2016 15:57:01 +0000 (15:57 +0000)
commitec00115bbc4f9c826338fb0d0ad6f1b949b6de3d
treea3db33b0b4d61049029415ade68a666820d70d56
parentc732b6bc6fcd81e93b2c0cefd7bee73df97f768a
Do not delegate a work to geom event thread which can be done inline.

In particular, swapongeom_ev() needed event thread context when swap
pager configuration was performed under Giant and geom asserted that
Giant is not owned.  Now both of the reason went away.

On the other hand, note that swpageom_release() is called from the
bio_done context, and possible close cannot be performed inline.

Also fix some minor issues.  The swapgeom() function does not use the
td argument, remove it.  Recheck that the vnode passed is still VCHR
and not reclaimed after the lock.

Reviewed by: mav
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
sys/vm/swap_pager.c