diff options
author | rstone <rstone@FreeBSD.org> | 2015-01-24 16:59:38 +0000 |
---|---|---|
committer | rstone <rstone@FreeBSD.org> | 2015-01-24 16:59:38 +0000 |
commit | 520ad845550c500350a7667fb69591ae7ac395c5 (patch) | |
tree | a2490451d33899ada0b73dc1dabd0e5b766efe2d | |
parent | 9dbba1ddabdba6f04969e6672a75762073b2babb (diff) | |
download | FreeBSD-src-520ad845550c500350a7667fb69591ae7ac395c5.zip FreeBSD-src-520ad845550c500350a7667fb69591ae7ac395c5.tar.gz |
vmspace_release() may sleep if the last reference is being released,
so add a WITNESS_WARN() to catch cases where it is called with a
non-sleepable lock held.
MFC after: 1 month
Sponsored by: Sandvine Inc.
-rw-r--r-- | sys/vm/vm_map.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index b8d67bd..b7e668b 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -344,6 +344,9 @@ void vmspace_free(struct vmspace *vm) { + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "vmspace_free() called with non-sleepable lock held"); + if (vm->vm_refcnt == 0) panic("vmspace_free: attempt to free already freed vmspace"); |