Re: coLinux benchmarks

From: Dan Aloni
Date: Mon Apr 05 2004 - 09:06:44 EST


On Mon, Apr 05, 2004 at 02:30:56PM +0100, Christoph Hellwig wrote:
> > The VM shows better results than the host. What gives? Perhaps
> > it is because of the combination of the host and guest's buffer
> > cache? I'd like to know about more percise benchmarking methods
> > for VMs.
>
> How are the virtual disks for the VM implemented? If you're doing
> direct I/O these numbers are indeed strange. If not OTOH that's
> expected because even synchronous I/O in the guest is actually
> async which makes it a lot faster.

The virtual block device driver in coLinux, named cobd, is synchronous
with the host OS highest level read()/write() functions, which
means e.g. for a READ block I/O request in the guest,
filp->f_op->read() is called on an open 'struct file' in the host.
If the call blocks, the entire guest VM blocks on it.

So, according to this, any type of I/O in the guest means synchronous
I/O in the host unless the data is already in the guest's buffer cache.

It's not really the implementation I am planning to stick to, but
it sure was very easy to implement.

BTW, the block device on the host side can be a file or any
device that exposes read()/write() interfaces to userspace. In
this benchmarking case it is a 3GB file that hosts an image of
an ext3 filesystem.

--
Dan Aloni
da-x@xxxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/