[GSOC] bhyve instruction caching

Mihai Carabas mihai.carabas at gmail.com
Sun Jun 1 19:55:50 UTC 2014


Hi,

I will continue my status report inline.

>
> I will come next week with some feedback on some strategies for
> caching efficiently the instructions and probably some implementation
> details.
The cached instruction is identified by the "struct vm*" (basically is
the virtual machine ID), the CR3 value (address of the pagetable) and
the IP (instruction pointer) of the instruction. All these are
inserted in a new structure named "struct vie_cached".

After a discussion with Neel I've decided to create a hashtable which
will only use the "struct vm*" as a key. The reason is simple: if one
virtual machine is trashing the instruction cache we don't want this
to affect/slow down other virtual machines (one hashtable entry is
guarded by a rmlock to guarantee exclusive access). A hashtable entry
will point to a list of "struct vie_cached*" entries.

To calculate the key of the hashtable based on the "struct vm" pointer
I've used the jenkins hash [1]

These days I've started a discussion with Neel about some
microbenchmarking mechanisms. I will come with some more details next
week.

Thanks,
Mihai

[1] /usr/src/sys/libkern/jenkins_hash.c


More information about the soc-status mailing list