Re: Implementing NVMHCI...

From: Avi Kivity
Date: Mon Apr 13 2009 - 02:33:40 EST


Linus Torvalds wrote:
On Sun, 12 Apr 2009, Avi Kivity wrote:
A quick test shows that it can. I didn't try mmap(), but copying files around
worked.

You being who you are, I'm assuming you're doing this in a virtual environment, so you might be able to see the IO patterns..


Yes. I just used the Windows performance counters rather than mess with qemu for the test below.

Can you tell if it does the IO in chunks of 16kB or smaller? That can be hard to see with trivial tests (since any filesystem will try to chunk up writes regardless of how small the cache entry is, and on file creation it will have to write the full 16kB anyway just to initialize the newly allocated blocks on disk), but there's a couple of things that should be reasonably good litmus tests of what WNT does internally:

- create a big file,

Just creating a 5GB file in a 64KB filesystem was interesting - Windows was throwing out 256KB I/Os even though I was generating 1MB writes (and cached too). Looks like a paranoid IDE driver (qemu exposes a PIIX4).

then rewrite just a few bytes in it, and look at the IO pattern of the result. Does it actually do the rewrite IO as one 16kB IO, or does it do sub-blocking?

It generates 4KB writes (I was generating aligned 512 byte overwrites). What's more interesting, it was also issuing 32KB reads to fill the cache, not 64KB. Since the number of reads and writes per second is almost equal, it's not splitting a 64KB read into two.

If the latter, then the 16kB thing is just a filesystem layout issue, not an internal block-size issue, and WNT would likely have exactly the same issues as Linux.

A 1 byte write on an ordinary file generates a RMW, same as a 4KB write on a 16KB block. So long as the filesystem is just a layer behind the pagecache (which I think is the case on Windows), I don't see what issues it can have.

- can you tell how many small files it will cache in RAM without doing IO? If it always uses 16kB blocks for caching, it will be able to cache a _lot_ fewer files in the same amount of RAM than with a smaller block size.

I'll do this later, but given the 32KB reads for the test above, I'm guessing it will cache pages, not blocks.

Of course, the _really_ conclusive thing (in a virtualized environment) is to just make the virtual disk only able to do 16kB IO accesses (and with 16kB alignment). IOW, actually emulate a disk with a 16kB hard sector size, and reporting a 16kB sector size to the READ CAPACITY command. If it works then, then clearly WNT has no issues with bigger sectors.

I don't think IDE supports this? And Windows 2008 doesn't like the LSI emulated device we expose.

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
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/