diff options
author | alc <alc@FreeBSD.org> | 2002-06-01 22:41:43 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-06-01 22:41:43 +0000 |
commit | 2abbbe7b8ae79822d494eacb2a9b49121b49dd80 (patch) | |
tree | 465b654ab56d40481dcfcc0a70962700baa25ef5 /sys/vm | |
parent | f70773e9649efef1e0a3d1066233ee55c5ac6b21 (diff) | |
download | FreeBSD-src-2abbbe7b8ae79822d494eacb2a9b49121b49dd80.zip FreeBSD-src-2abbbe7b8ae79822d494eacb2a9b49121b49dd80.tar.gz |
o Remove GIANT_REQUIRED from vm_map_zfini(), vm_map_zinit(),
vm_map_create(), and vm_map_submap().
o Make further use of a local variable in vm_map_entry_splay()
that caches a reference to one of a vm_map_entry's children.
(This reduces code size somewhat.)
o Revert a part of revision 1.66, deinlining vmspace_pmap().
(This function is MPSAFE.)
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_map.c | 31 | ||||
-rw-r--r-- | sys/vm/vm_map.h | 9 |
2 files changed, 15 insertions, 25 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 853815c..04cc0ef 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -191,7 +191,6 @@ vm_map_zfini(void *mem, int size) { vm_map_t map; - GIANT_REQUIRED; map = (vm_map_t)mem; lockdestroy(&map->lock); @@ -202,8 +201,6 @@ vm_map_zinit(void *mem, int size) { vm_map_t map; - GIANT_REQUIRED; - map = (vm_map_t)mem; map->nentries = 0; map->size = 0; @@ -426,12 +423,6 @@ _vm_map_clear_recursive(vm_map_t map, const char *file, int line) { } -struct pmap * -vmspace_pmap(struct vmspace *vmspace) -{ - return &vmspace->vm_pmap; -} - long vmspace_resident_count(struct vmspace *vmspace) { @@ -450,8 +441,6 @@ vm_map_create(pmap_t pmap, vm_offset_t min, vm_offset_t max) { vm_map_t result; - GIANT_REQUIRED; - result = uma_zalloc(mapzone, M_WAITOK); CTR1(KTR_VM, "vm_map_create: %p", result); _vm_map_init(result, min, max); @@ -544,39 +533,35 @@ vm_map_entry_splay(vm_offset_t address, vm_map_entry_t root) if (root == NULL) return (root); lefttreemax = righttreemin = &dummy; - for (;;) { + for (;; root = y) { if (address < root->start) { - if (root->left == NULL) + if ((y = root->left) == NULL) break; - if (address < root->left->start) { + if (address < y->start) { /* Rotate right. */ - y = root->left; root->left = y->right; y->right = root; root = y; - if (root->left == NULL) + if ((y = root->left) == NULL) break; } /* Link into the new root's right tree. */ righttreemin->left = root; righttreemin = root; - root = root->left; } else if (address >= root->end) { - if (root->right == NULL) + if ((y = root->right) == NULL) break; - if (address >= root->right->end) { + if (address >= y->end) { /* Rotate left. */ - y = root->right; root->right = y->left; y->left = root; root = y; - if (root->right == NULL) + if ((y = root->right) == NULL) break; } /* Link into the new root's left tree. */ lefttreemax->right = root; lefttreemax = root; - root = root->right; } else break; } @@ -1176,8 +1161,6 @@ vm_map_submap( vm_map_entry_t entry; int result = KERN_INVALID_ARGUMENT; - GIANT_REQUIRED; - vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index 02d3b47..b4c75e6 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -218,6 +218,14 @@ struct vmspace { }; #ifdef _KERNEL +static __inline pmap_t +vmspace_pmap(struct vmspace *vmspace) +{ + return &vmspace->vm_pmap; +} +#endif /* _KERNEL */ + +#ifdef _KERNEL /* * Macros: vm_map_lock, etc. * Function: @@ -252,7 +260,6 @@ void _vm_map_clear_recursive(vm_map_t map, const char *file, int line); #define vm_map_clear_recursive(map) \ _vm_map_clear_recursive(map, LOCK_FILE, LOCK_LINE) -struct pmap *vmspace_pmap(struct vmspace *vmspace); long vmspace_resident_count(struct vmspace *vmspace); #endif /* _KERNEL */ |