summaryrefslogtreecommitdiffstats
path: root/sys/kern/sysv_shm.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-07-27 03:53:41 +0000
committeralc <alc@FreeBSD.org>2004-07-27 03:53:41 +0000
commit8a38bc6b2ce7980dbddef0dc33bfba51ec5d3824 (patch)
tree6d7127f6cedfdcd82a7c1768b6c913502023d8cf /sys/kern/sysv_shm.c
parenta745685147cf8bdd139918b29529822fc40acdf6 (diff)
downloadFreeBSD-src-8a38bc6b2ce7980dbddef0dc33bfba51ec5d3824.zip
FreeBSD-src-8a38bc6b2ce7980dbddef0dc33bfba51ec5d3824.tar.gz
- Use atomic ops for updating the vmspace's refcnt and exitingcnt.
- Push down Giant into shmexit(). (Giant is acquired only if the vmspace contains shm segments.) - Eliminate the acquisition of Giant from proc_rwmem(). - Reduce the scope of Giant in exit1(), uncovering the destruction of the address space.
Diffstat (limited to 'sys/kern/sysv_shm.c')
-rw-r--r--sys/kern/sysv_shm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c
index 1430942..0b016f1 100644
--- a/sys/kern/sysv_shm.c
+++ b/sys/kern/sysv_shm.c
@@ -822,14 +822,14 @@ shmexit_myhook(struct vmspace *vm)
struct shmmap_state *base, *shm;
int i;
- GIANT_REQUIRED;
-
if ((base = vm->vm_shm) != NULL) {
vm->vm_shm = NULL;
+ mtx_lock(&Giant);
for (i = 0, shm = base; i < shminfo.shmseg; i++, shm++) {
if (shm->shmid != -1)
shm_delete_mapping(vm, shm);
}
+ mtx_unlock(&Giant);
free(base, M_SHM);
}
}
OpenPOWER on IntegriCloud