Nowadays, in Google Cloud Engine (GCE), it is possible to attach a local SSD with the NVMe interface to your virtual machine.nfortunately, you only get a good number of iops (input/output operations per second) if you instaniate a machine with other available distributions on GCE will have a lower number of iops.
It turns out that Google's Virtual Machine Monitor (aka Hypervisor) implements a custom NVMe command that to increase up to times , the kernel you use needs to support it and this is not mainline kernel.
Collabora helping updatrefactorreview the patches to the Linux Ke to send it upstream,
s it increases performance, the feature in the process discussed and proposed to the NVMe workgroup with Collabora's help.
he nvmexpress.org seems add an oficial extension to stardarize its publish , nothing defined yet, recent discussion and can take a year to be ratified by the NVMe workgroup.
So, , you can get a more recent version of the patch and install the driver yourself here:
How it works?
Technical details
The NVMe interface basicaly works with command queues. The drive writes a command in a region known to both (driver and device controller) and then update the tail of the queue writting to an MMIO register called doorbell.
In an environment with several guest OSes on top of a VMM sharing a resource, communication between the guest OS and the real device is usually trapped by the VMM. As an MMIO is usually a syncronous acces to the device, it means that every MMIO access will cause a trap.
The main idea is to decrease the number of traps to the VMM by reducing the number of writtes to the doorbells.
This is achieved in two ways:
Batching
Letting the VMM pull the current doorbell value when it is already in execution
The first one is easy, we can wait X commands to be written in the queue to ring the doorbell.
The second one is a bit more complicated. The guest OS needs to inform the emulated device in the VMM where it can pull the doorbell values, and the emulated NVMe device needs to inform the guest OS that it can restart the cout of X.
This is what feature does:
It adds a new command in the NVMe interface where the driver can send to the NVMe device controller two memory buffers:
1) here the real doorbell values areIntead of writting to the MMIO doorbell, the driver writtes the value in this buffer
2) hint from the controller about how many commands the driver can write in the queue without ringing the doorbell
No comments:
Post a Comment