Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Trying to evaluate the performance for dm-writeboost #194
I am trying to evaluate the performance of dm-writeboost for a school project. Basically, I am trying to show the performance of dm-writeboost is better (more speed) when the size of the cache increases. I am manually setting the wb->nr_segments variable to do this.
I have noticed that the speed of the cache slows down when urge_writeback becomes true. (That is what I think is happening.) I have nr_batch set to 4, which may be why it is slow. When urge_writeback becomes true, dm-writeboost becomes slower than the backing device. Therefore, I have tried to evaluate dm-writeboost so that the entire workload fits in the cache device. That way, the cache does not need for the writeback daemon to finish writeback in the middle of the workload.
My test setup is as follows. I use Postmark, but modified so that the open() system call is used with the O_DIRECT and O_SYNC option. I choose the buffering setting to be false. I also deactivated the write cache of my hard drive with the hdparm -W 0 option. This guarantees that the only cache being evaluated is dm-writeboost. There should be no interference from another cache. I first allow the system to run a workload for about five minutes, which fills the cache device. This gives the best chance for hits when I run another workload. I then make the cache writeback all dirty caches to the backing device with drop_caches, to make sure writeback will not interrupt the next workload. I then run a smaller workload that fits completely in the cache device and observe the speed and hit rate.
I have two questions:
I understand if you are busy and do not have time to consider my question for very long. If you even read this far, I am already grateful.
I have read some discussions online about O_DIRECT, and I am not sure what is happening. After more measurements, I am seeing that dm-writeboost has no effect on the inherent speed of the backing device when O_DIRECT is used. After running for a few minutes at the speed of the backing device, the cache slows down, just like it would if the writeback daemon turns on when urge_writeback is true. The cache statistics are updated, just like it would be if the cache worked normally.
Discussion online seems to indicate that O_DIRECT bypasses the kernel and causes IO to happen via DMA. If true, that would explain why dm-writeboost has no change with increasing cache size: the cache is not being used. However, this is contradicted by the fact that the cache statistics are being updated normally. I am still not sure how to interpret my results, but my solution is to stop using the O_DIRECT flag for my measurements. I will share the results of my measurements if they make sense.