I’m a filesystem developer new to Windows. I’ve written a
homegrown metadata cache for my fs. It basically seems to work but
I find that on Windows, when I flush my metadata cache to my log file,
the performance is terrible. I flushed to my log when I got
to ~1MB of dirty metadata. The buffers in my homegrown
cache are 512 bytes each. So I’m flushing about 2000 of
them. The flush takes about 15 seconds or a throughput
of about 70kb/second. Here is my flush algorithm:
This kicks them all off asynchronously, as I understand it.
Then I wait for all the I/O’s to complete. I try to be smart by
waiting on the last one I started:
while (not done)
KeWaitForSingleObject(event)
My I/O completion routine marks my metadata buffers as
being “done” so I only wait for those that are still pending.
As I said, this does seem to work. But the performance is
so bad, I feel like I’m missing a basic Windows concept.
This algorithm works well on other platforms.
I’m a filesystem developer new to Windows. I’ve written a
homegrown metadata cache for my fs. It basically seems to work but
I find that on Windows, when I flush my metadata cache to my log file,
the performance is terrible. I flushed to my log when I got
to ~1MB of dirty metadata. The buffers in my homegrown
cache are 512 bytes each. So I’m flushing about 2000 of
them. The flush takes about 15 seconds or a throughput
of about 70kb/second. Here is my flush algorithm:
This kicks them all off asynchronously, as I understand it.
Then I wait for all the I/O’s to complete. I try to be smart by
waiting on the last one I started:
while (not done)
KeWaitForSingleObject(event)
My I/O completion routine marks my metadata buffers as
being “done” so I only wait for those that are still pending.
As I said, this does seem to work. But the performance is
so bad, I feel like I’m missing a basic Windows concept.
This algorithm works well on other platforms.