]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
When code from r254064 in pmap_ts_referenced() drops pv lock and
authorKonstantin Belousov <kib@FreeBSD.org>
Sun, 18 Aug 2013 21:36:22 +0000 (21:36 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Sun, 18 Aug 2013 21:36:22 +0000 (21:36 +0000)
commitd91f339823025f2c124e3813ac82b25e9804bbbb
tree8090c377de586f7d10e88fac7a08c24e84bce578
parent11e0ddb14667648b8378686e2f97e092eb21af74
When code from r254064 in pmap_ts_referenced() drops pv lock and
blocks on a pmap lock, pmap_release() might proceed in parallel and
destroy the pmap mutex, since unlocked pv lock allows to remove pv
entry owned by the pmap.

For now, gate the pmap_release() on write-locked pvh_global_lock.
Since pmap_ts_release() does not unlock the global lock,
pmap_release() would not destroy pmap mutex until the
pmap_ts_referenced() finished.  We cannot enter pmap_ts_referenced()
and encounter a pv entry for the destroyed pmap if pmap_release()
passed the global lock gate, since pmap_remove_pages() would finish
earlier.

Reported by: jeff, pho
Reviewed by: alc
Tested by: pho
Sponsored by: The FreeBSD Foundation
sys/amd64/amd64/pmap.c