Another updated RTC driver for vmware users to try

Mike Silbersack silby at silby.com
Mon Feb 23 22:31:16 PST 2004


On Sat, 21 Feb 2004, Byron Brummer wrote:

> 	I'm happy to report I just gave this update a whirl and it made a
> 	*HUGE* difference.  Not quite 100% the match with Linux's
> 	performance running the Alleg server, but lightyears better then
> 	the last version (which was lightyears beyond the version it
> 	replaced).

Good!

> 	So from a user perspective it looks like you're very much on
> 	the right track.  You say it sleeps too much...is there a way,
> 	perhaps at the cost of extra CPU, to "overclock" the RTC driver
> 	so that it barely sleeps if at all?  Because of the "twitch"
> 	nature of this game I care more about the response of this server
> 	then of anything else on the machine.

It would be possible to "overclock" the rtc driver, you could simply go
into the code and find the rtc_ioctl function.  Change the line
"sc->var.freq = freq" to "sc->var.freq = freq * 2", and the interrupts
should come at 2x the clockrate!  (Make sure to up your system's kern.hz
appropriately so that the extra rate really happens.)

However, I don't think that is the problem.  As you'll note in rtc_read,
the driver tracks the number of interrupts which were missed, meaning that
vmware did not call rtc_read to check in X number of interrupts.  Well,
when I threw a printf in there monitoring the count, I saw frequent
spikes, as high as 200 missed interrupts at a time.  This was with a
virtually idle virtual machine!

Whether this really means that vmware is getting behind or not, I am
unsure.  However, it does seem to suggest that the rtc driver is about as
good as it is going to get, and that I may need to look elsewhere in the
FreeBSD code to find the bottlenecks relative to the linux modules.

Try the "overclocking" above and see how it works.  Perhaps if it's
successful I should make it the default. :)

Hm, one other thought just struck me... I'm relying on the select syscall
to perform the wakeups... perhaps our select is doing some sort of
rounding off which is reducing the accuracy of the wakeups, I'll have to
check that out.

Mike "Silby" Silbersack


More information about the freebsd-emulation mailing list