]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/kern/kern_exec.c
vmspace: Convert to refcount(9)
authorMark Johnston <markj@FreeBSD.org>
Wed, 4 Nov 2020 16:30:56 +0000 (16:30 +0000)
committerMark Johnston <markj@FreeBSD.org>
Wed, 4 Nov 2020 16:30:56 +0000 (16:30 +0000)
commitf7db0c9532521496366564e579d0eadc9134dad0
tree1c7f51e9c681dd9fb848fddfd59209fbb179cbc3
parente89004612a68b90e7c4667ce5e59664078424d83
vmspace: Convert to refcount(9)

This is mostly mechanical except for vmspace_exit().  There, use the new
refcount_release_if_last() to avoid switching to vmspace0 unless other
processes are sharing the vmspace.  In that case, upon switching to
vmspace0 we can unconditionally release the reference.

Remove the volatile qualifier from vm_refcnt now that accesses are
protected using refcount(9) KPIs.

Reviewed by: alc, kib, mmel
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27057
sys/dev/cxgbe/tom/t4_ddp.c
sys/kern/init_main.c
sys/kern/kern_exec.c
sys/kern/vfs_aio.c
sys/vm/vm_glue.c
sys/vm/vm_map.c
sys/vm/vm_map.h