Rename vm_page_rename() to vm_page_iter_rename() to reflect its reimplementation using iterators, and pass the page to this function rather than spending clock cycles looking it up. Change its return value from 0/1 to a bool.
Details
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comments in vm_reserv.c need to be updated to reflect this change.
If you have measured the improvement, how big is it?
sys/vm/vm_page.c | ||
---|---|---|
2072 | Perhaps further clarify that failure happens only when memory allocation fails. In particular, if a page already exists at the destination, we panic. I'd also clarify that the page is passed directly only as an optimization. | |
2096 | I believe we can strengthen this to KASSERT((m->ref_count & VPRC_OBJREF) != 0, as in vm_page_insert_radixdone() for example. |
sys/vm/vm_object.c | ||
---|---|---|
1793–1794 | Fix comment. |
sys/vm/vm_page.c | ||
---|---|---|
2072 | I didn't describe passing the page as being an optimization as I'm afraid that doing so could be misinterpreted as meaning that NULL can be passed. |
The conversion to iterators made vm_object_collapse_scan() and vm_object_split() slower by 14% and 5-6%, respectively. This change eliminates about half of that slowdown in each case.
sys/vm/vm_page.c | ||
---|---|---|
2075 | vm_radix_insert_lookup_lt() panics. |