There's no real reason that vm_radix_insert_lookup_lt has to panic when an insertion attempt fails because there's already an entry there with that pindex. By not panicking, and instead just returning a nonzero code, it allows ttm_bo_vm_fault to avoid a lookup before inserting, knowing that insert will be a harmless no-op when the item is already present.
Details
Details
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
I'm okay with the idea but I'm a little worried that it changes the semantics of vm_page_insert / vm_page_insert_after, which I just preserved with the insert_lookup patch. Those two procedures have several callers. However, several of the callers appear to be broken (lacking error checks), so maybe we should audit them all anyway.
Do we maybe actually want to provide a vm_page_find_or_insert(), and leave vm_page_insert / vm_page_insert_after with their strict behavior?
sys/dev/drm2/ttm/ttm_bo_vm.c | ||
---|---|---|
245–246 | I don't think this is right on EEXIST. | |
sys/vm/vm_radix.h | ||
72–83 | This would then become vm_radix_insert_lookup_le, and we'd want to update the comment. |