OS-6793: vmm malloc/free are inefficient

Details

Issue Type:Bug
Priority:4 - Normal
Status:Resolved
Created at:2018-03-19T16:18:49.747Z
Updated at:2018-06-05T13:07:39.305Z

People

Created by:Hans Rosenfeld [X]
Reported by:Hans Rosenfeld [X]
Assigned to:Hans Rosenfeld [X]

Resolution

Fixed: A fix for this issue is checked into the tree and tested.
(Resolution Date: 2018-06-05T13:07:39.292Z)

Fix Versions

2018-06-07 Train Graveyard (Release Date: 2018-06-07)

Related Links

Labels

bhyve

Description

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.

Comments

Comment by Hans Rosenfeld [X]
Created at 2018-05-04T14:25:18.269Z

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.


Comment by Jira Bot
Created at 2018-06-05T09:01:04.696Z

illumos-joyent commit 482fe661398410e5c6eab4b05791d77516d14601 (branch master, by Hans Rosenfeld)

OS-6793 vmm malloc/free are inefficient
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: Patrick Mooney <patrick.mooney@joyent.com>