|Priority:||4 - Normal|
|Created by:||Hans Rosenfeld [X]|
|Reported by:||Hans Rosenfeld [X]|
|Assigned to:||Hans Rosenfeld [X]|
Fixed: A fix for this issue is checked into the tree and tested.
(Resolution Date: 2018-06-05T13:07:39.292Z)
2018-06-07 Train Graveyard (Release Date: 2018-06-07)
The implementation of malloc() and free() in vmm_sol_glue.c uses a single list of struct kmem_item to store information about each allocation. That is fast enough for malloc(), but every free() has to search the list to find the item with the correct address.
In the case of OS-6740, this leads to several minutes worth of free()ing pages when the page tables for the IOMMU host domain are deallocated on last VM shutdown.
Testing: I've been runnning this change for a few weeks now, creating and destroying VMs and all that without any ill effects seen. I also verified that the hash table is more or less evenly used, which admittedly is because it is tuned towards page allocations, which are by far the most allocations done. If we change the IOMMU code to be more efficient in that regard we might want to revisit the hash table parameters later.
illumos-joyent commit 482fe661398410e5c6eab4b05791d77516d14601 (branch master, by Hans Rosenfeld)
OS-6793 vmm malloc/free are inefficient
Reviewed by: Jerry Jelinek <firstname.lastname@example.org>
Reviewed by: Patrick Mooney <email@example.com>
Approved by: Patrick Mooney <firstname.lastname@example.org>