|
From: | zhoushl |
Subject: | Re: [PATCH] block/file-posix.c: No need to sync data when aio + dio is enabled |
Date: | Thu, 27 Apr 2023 21:22:09 +0800 |
Hi Kevin: I’m sorry for missing commit message, next time I will be careful. When the application in guest vm execute fsync, qemu will execute fsync too. But when aio + dio is enabled, pagecache is bypassed and we could assure the data is on disk(at least on the disk cache), so there is no needto sync anymore. For example, we could execute the following python script in vm: #!/usr/bin/python import os fo = os.open(“test.txt”, os.O_RDWR|os.O_CREAT) while True: os.write(fo, “123\n”) os.fsync(fo) os.closed(fo) In this case, each write will take an fsync operation, which will search the dirty page in pagecache, force flushing the metadata and data into disk, which is often useless and waste IO resource and maybe will cause write amplification in filesystem.
|
[Prev in Thread] | Current Thread | [Next in Thread] |