microfind is somewhat less than ideal
The kernel has a function,
tenmicrosec(), for generating a delay of around 10 microseconds using a spin loop. When this function is used early in boot, prior to the configuration of more modern timing services, this function uses a loop count (
microdata) calibrated to take about 10 microseconds to complete.
The function that calibrates
microdata for the machine's CPU,
microfind(), is a bit rubbish. The function is quite rough around the edges, both in code and comments, and worst of all: it does not seem to work properly.
The failure becomes particularly pronounced when the OS is booted via iPXE in a VMware guest, when the OS panics most (but not all!) times this particular method of booting is attempted. Upon inspection, it seems that our use of the i8254 Programmable Interval Timer is itself not incorrect; nor is the emulated PIT malfunctioning in any detectable way.
In order to fix the problem a simpler, better documented replacement will be substituted for the existing
microfind() implementation. The replacement function will make repeated trials of delay measurement in order to smooth out jitter in the scheduling of virtual machine guests.
Updated by Electric Monk almost 7 years ago
- Status changed from New to Closed
commit 29e54759b5b8e21fb481d44ee504a764aa7b6ea2 Author: Joshua M. Clulow <email@example.com> Date: 2015-10-24T22:23:12.000Z 6347 microfind is somewhat less than ideal Reviewed by: Patrick Mooney <firstname.lastname@example.org> Reviewed by: Robert Mustacchi <email@example.com> Reviewed by: Hans Rosenfeld <firstname.lastname@example.org> Reviewed by: Josef 'Jeff' Sipek <email@example.com> Approved by: Garrett D'Amore <firstname.lastname@example.org>