Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_radix.h
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static __inline int | static __inline int | ||||
vm_radix_insert(struct vm_radix *rtree, vm_page_t page) | vm_radix_insert(struct vm_radix *rtree, vm_page_t page) | ||||
{ | { | ||||
return (VM_RADIX_PCTRIE_INSERT(&rtree->rt_trie, page)); | return (VM_RADIX_PCTRIE_INSERT(&rtree->rt_trie, page)); | ||||
} | } | ||||
/* | /* | ||||
* Insert the page into the vm_radix tree with its pindex as the key. Panic if | |||||
* the pindex already exists. Return zero on success or a non-zero error on | |||||
* memory allocation failure. Set the out parameter mpred to the previous page | |||||
* in the tree as if found by a previous call to vm_radix_lookup_le with the | |||||
* new page pindex. | |||||
*/ | |||||
static __inline int | |||||
vm_radix_insert_lookup_lt(struct vm_radix *rtree, vm_page_t page, | |||||
vm_page_t *mpred) | |||||
{ | |||||
int error; | |||||
error = VM_RADIX_PCTRIE_INSERT_LOOKUP_LE(&rtree->rt_trie, page, mpred); | |||||
if (__predict_false(error == EEXIST)) | |||||
dougm: So, the KASSERT you're dropping above has no effect in a GENERIC-NODEBUG build, but this check… | |||||
Done Inline ActionsI believe I'm preserving the GENERIC-NODEBUG behavior from before the patch. vm_radix_insert() does a hard panic on a collision. rlibby: I believe I'm preserving the GENERIC-NODEBUG behavior from before the patch. vm_radix_insert()… | |||||
panic("vm_radix_insert_lookup_lt: page already present, %p", | |||||
*mpred); | |||||
return (error); | |||||
} | |||||
/* | |||||
* Returns the value stored at the index assuming there is an external lock. | * Returns the value stored at the index assuming there is an external lock. | ||||
* | * | ||||
* If the index is not present, NULL is returned. | * If the index is not present, NULL is returned. | ||||
*/ | */ | ||||
static __inline vm_page_t | static __inline vm_page_t | ||||
vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index) | vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index) | ||||
{ | { | ||||
return (VM_RADIX_PCTRIE_LOOKUP(&rtree->rt_trie, index)); | return (VM_RADIX_PCTRIE_LOOKUP(&rtree->rt_trie, index)); | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |
So, the KASSERT you're dropping above has no effect in a GENERIC-NODEBUG build, but this check will still be made in that build. So is this better than KASSERT(error != EEXIST)?