Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jun 2014 20:58:12 +0300
From:      Mihai Carabas <mihai.carabas@gmail.com>
To:        soc-status@freebsd.org
Subject:   Re: [GSOC] bhyve instruction caching
Message-ID:  <CANg1yUsmRCSftYgFWZu_xu-nCROMn3FvuXzfgteiuy4LtAJtvQ@mail.gmail.com>
In-Reply-To: <CANg1yUuZU0--O8RgOVx=jKhku1yguvmO4TxUZ5c4wEq6jk6fSw@mail.gmail.com>
References:  <CANg1yUuazrhybHVVzi2g8vCBSTx3Z=gYmEVXvEMuj2SN%2BRY9Sg@mail.gmail.com> <CANg1yUu_b0qSX=2eXRaO31cogjGdSmkDnEh7PAjfVvCMsAaC1g@mail.gmail.com> <CANg1yUuZU0--O8RgOVx=jKhku1yguvmO4TxUZ5c4wEq6jk6fSw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jun 8, 2014 at 12:38 AM, Mihai Carabas <mihai.carabas@gmail.com> wrote:
>>
>> These days I've started a discussion with Neel about some
>> microbenchmarking mechanisms. I will come with some more details next
>> week.
> I've built a microbenchmarking kernel module which is accessing the
> lapic->id for 1000000 and than I calculate the average of an access
> (each access needs to be emulated by the hypervisor).
>
> I've also implemented the instuction caching mechanism. At each emulation:
> - I check to see if I have that particular instruction cached
> - if not I will cache it in a particula structure named "struct vie_cached" [1]
> - if it's cached I just use that instruction
>
> Right now I am working on write-protecting the pages where the
> instruction reside. I will come with some more details/results when I
> finished this part too (there are some SMP issues I'm still debating
> with Neel).

I added the write protection for the pages where instruction resides
(I mark them with PROT_READ|PROT_EXECUTE using vm_map_protect). When a
page fault is raised on that page I delete the instruction from the
cache. I've tested the instruction caching feature and it works ok (no
bugs reveal). The results on the microbenchmarking are looking OK, but
they aren't conclusive because I'm not write protecting the pages of
the pagetable (which will eat more time). Right now for 1000000
accesses to the lapic-id we have an average of 6200 ticks per VM_EXIT
for an instruction emulation. Without instruction caching the average
is at about 10000ticks. Like I've said before, this results aren't
very conclusive until I introduce all protections needed. I will come
in the next weeks with more results when I have the caching feature
fully implemented.

I've also introduce a new systl to enable/disable instruction caching
"hw.vmm.instruction_cache".

Thanks,
Mihai



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANg1yUsmRCSftYgFWZu_xu-nCROMn3FvuXzfgteiuy4LtAJtvQ>