From 93bc4879e6332c1564d60c22308b0ffa2e63cc99 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 12 Jul 2002 23:20:06 +0000 Subject: o Assert GIANT_REQUIRED on system maps in _vm_map_lock(), _vm_map_lock_read(), and _vm_map_trylock(). Submitted by: tegge o Remove GIANT_REQUIRED from kmem_alloc_wait() and kmem_free_wakeup(). (This clears the way for exec_map accesses to move outside of Giant. The exec_map is not a system map.) o Remove some premature MPSAFE comments. Reviewed by: tegge --- sys/vm/vm_kern.c | 9 --------- sys/vm/vm_map.c | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'sys/vm') diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 5f6ef3f785a4..c3a1312ff1f1 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -96,8 +96,6 @@ vm_map_t buffer_map=0; * * Allocate pageable memory to the kernel's address map. * "map" must be kernel_map or a submap of kernel_map. - * - * MPSAFE */ vm_offset_t kmem_alloc_pageable(map, size) @@ -121,8 +119,6 @@ kmem_alloc_pageable(map, size) * kmem_alloc_nofault: * * Same as kmem_alloc_pageable, except that it create a nofault entry. - * - * MPSAFE */ vm_offset_t kmem_alloc_nofault(map, size) @@ -225,8 +221,6 @@ kmem_alloc(map, size) * associated with that region. * * This routine may not block on kernel maps. - * - * MPSAFE */ void kmem_free(map, addr, size) @@ -456,8 +450,6 @@ kmem_alloc_wait(map, size) { vm_offset_t addr; - GIANT_REQUIRED; - size = round_page(size); for (;;) { @@ -493,7 +485,6 @@ kmem_free_wakeup(map, addr, size) vm_offset_t addr; vm_size_t size; { - GIANT_REQUIRED; vm_map_lock(map); (void) vm_map_delete(map, trunc_page(addr), round_page(addr + size)); diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 21b91d0ac686..6b107db3f1de 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -360,6 +360,8 @@ _vm_map_lock(vm_map_t map, const char *file, int line) { int error; + if (map->system_map) + GIANT_REQUIRED; error = lockmgr(&map->lock, LK_EXCLUSIVE, NULL, curthread); KASSERT(error == 0, ("%s: failed to get lock", __func__)); map->timestamp++; @@ -377,6 +379,8 @@ _vm_map_lock_read(vm_map_t map, const char *file, int line) { int error; + if (map->system_map) + GIANT_REQUIRED; error = lockmgr(&map->lock, LK_EXCLUSIVE, NULL, curthread); KASSERT(error == 0, ("%s: failed to get lock", __func__)); } @@ -393,6 +397,8 @@ _vm_map_trylock(vm_map_t map, const char *file, int line) { int error; + if (map->system_map) + GIANT_REQUIRED; error = lockmgr(&map->lock, LK_EXCLUSIVE | LK_NOWAIT, NULL, curthread); return (error == 0); } -- cgit v1.2.3