* [Qemu-devel] linux aio and cache mode
@ 2012-09-24 11:32 ching
2012-09-24 12:30 ` Kevin Wolf
0 siblings, 1 reply; 7+ messages in thread
From: ching @ 2012-09-24 11:32 UTC (permalink / raw)
To: qemu-devel
Hi all,
My host is qemu-1.1.1 and x64 kernel 3.5.4. The guest is using aio="native"
I am trying to use unsafe cache mode to boost i/o performance.
After googling a while, there are some old web page telling that linux native aio do not use host cache. (http://stackoverflow.com/questions/5664105/buffered-asynchronous-file-i-o-on-linux)
is it still valid for recent kernel? do i need to change to aio="threads" to take advantage of unsafe cache mode?
Thanks in advance.
Regards,
ching
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] linux aio and cache mode
2012-09-24 11:32 [Qemu-devel] linux aio and cache mode ching
@ 2012-09-24 12:30 ` Kevin Wolf
2012-09-24 22:40 ` ching
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2012-09-24 12:30 UTC (permalink / raw)
To: ching; +Cc: qemu-devel
Am 24.09.2012 13:32, schrieb ching:
> Hi all,
>
> My host is qemu-1.1.1 and x64 kernel 3.5.4. The guest is using aio="native"
>
> I am trying to use unsafe cache mode to boost i/o performance.
aio=native requires the image to be opened with O_DIRECT, i.e.
cache=none or cache=directsync. If you specify a different cache option,
it will silently fall back to aio=threads.
Kevin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] linux aio and cache mode
2012-09-24 12:30 ` Kevin Wolf
@ 2012-09-24 22:40 ` ching
2012-09-25 13:33 ` Kevin Wolf
0 siblings, 1 reply; 7+ messages in thread
From: ching @ 2012-09-24 22:40 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel
On 09/24/2012 08:30 PM, Kevin Wolf wrote:
> Am 24.09.2012 13:32, schrieb ching:
>> Hi all,
>>
>> My host is qemu-1.1.1 and x64 kernel 3.5.4. The guest is using aio="native"
>>
>> I am trying to use unsafe cache mode to boost i/o performance.
> aio=native requires the image to be opened with O_DIRECT, i.e.
> cache=none or cache=directsync. If you specify a different cache option,
> it will silently fall back to aio=threads.
>
> Kevin
>
will qemu log a entry for the silent fallback?
Reason:
I am testing sparse image on btrfs with mount option: rw,noatime,space_cache,autodefrag,inode_cache
i encounter a speed difference (around 2X-3X) between aio=threads,cache=unsafe and aio=native,cache=unsafe
aio=threads is much faster, i guest there is conflict between "autodefrag" and linux aio
ching
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] linux aio and cache mode
2012-09-24 22:40 ` ching
@ 2012-09-25 13:33 ` Kevin Wolf
2012-09-25 23:22 ` ching
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2012-09-25 13:33 UTC (permalink / raw)
To: ching; +Cc: qemu-devel
Am 25.09.2012 00:40, schrieb ching:
> On 09/24/2012 08:30 PM, Kevin Wolf wrote:
>> Am 24.09.2012 13:32, schrieb ching:
>>> Hi all,
>>>
>>> My host is qemu-1.1.1 and x64 kernel 3.5.4. The guest is using aio="native"
>>>
>>> I am trying to use unsafe cache mode to boost i/o performance.
>> aio=native requires the image to be opened with O_DIRECT, i.e.
>> cache=none or cache=directsync. If you specify a different cache option,
>> it will silently fall back to aio=threads.
>>
>> Kevin
>>
>
> will qemu log a entry for the silent fallback?
No, that's why it's silent. :-)
> Reason:
>
> I am testing sparse image on btrfs with mount option: rw,noatime,space_cache,autodefrag,inode_cache
>
> i encounter a speed difference (around 2X-3X) between aio=threads,cache=unsafe and aio=native,cache=unsafe
>
> aio=threads is much faster, i guest there is conflict between "autodefrag" and linux aio
This is odd. The point is that with cache=unsafe it shouldn't even be
using Linux AIO in the first place. I can't see why there would be any
difference between aio=threads and aio=native with cache=unsafe.
Kevin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] linux aio and cache mode
2012-09-25 13:33 ` Kevin Wolf
@ 2012-09-25 23:22 ` ching
2012-09-26 7:51 ` Kevin Wolf
0 siblings, 1 reply; 7+ messages in thread
From: ching @ 2012-09-25 23:22 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel
On 09/25/2012 09:33 PM, Kevin Wolf wrote:
> Am 25.09.2012 00:40, schrieb ching:
>> On 09/24/2012 08:30 PM, Kevin Wolf wrote:
>>> Am 24.09.2012 13:32, schrieb ching:
>>>> Hi all,
>>>>
>>>> My host is qemu-1.1.1 and x64 kernel 3.5.4. The guest is using aio="native"
>>>>
>>>> I am trying to use unsafe cache mode to boost i/o performance.
>>> aio=native requires the image to be opened with O_DIRECT, i.e.
>>> cache=none or cache=directsync. If you specify a different cache option,
>>> it will silently fall back to aio=threads.
>>>
>>> Kevin
>>>
>> will qemu log a entry for the silent fallback?
> No, that's why it's silent. :-)
>
>> Reason:
>>
>> I am testing sparse image on btrfs with mount option: rw,noatime,space_cache,autodefrag,inode_cache
>>
>> i encounter a speed difference (around 2X-3X) between aio=threads,cache=unsafe and aio=native,cache=unsafe
>>
>> aio=threads is much faster, i guest there is conflict between "autodefrag" and linux aio
> This is odd. The point is that with cache=unsafe it shouldn't even be
> using Linux AIO in the first place. I can't see why there would be any
> difference between aio=threads and aio=native with cache=unsafe.
>
> Kevin
>
is it possible to check the open mode of file and whether it is using aio at runtime?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] linux aio and cache mode
2012-09-25 23:22 ` ching
@ 2012-09-26 7:51 ` Kevin Wolf
2012-09-28 0:00 ` ching
0 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2012-09-26 7:51 UTC (permalink / raw)
To: ching; +Cc: qemu-devel
Am 26.09.2012 01:22, schrieb ching:
> On 09/25/2012 09:33 PM, Kevin Wolf wrote:
>> Am 25.09.2012 00:40, schrieb ching:
>>> On 09/24/2012 08:30 PM, Kevin Wolf wrote:
>>>> Am 24.09.2012 13:32, schrieb ching:
>>>>> Hi all,
>>>>>
>>>>> My host is qemu-1.1.1 and x64 kernel 3.5.4. The guest is using aio="native"
>>>>>
>>>>> I am trying to use unsafe cache mode to boost i/o performance.
>>>> aio=native requires the image to be opened with O_DIRECT, i.e.
>>>> cache=none or cache=directsync. If you specify a different cache option,
>>>> it will silently fall back to aio=threads.
>>>>
>>>> Kevin
>>>>
>>> will qemu log a entry for the silent fallback?
>> No, that's why it's silent. :-)
>>
>>> Reason:
>>>
>>> I am testing sparse image on btrfs with mount option: rw,noatime,space_cache,autodefrag,inode_cache
>>>
>>> i encounter a speed difference (around 2X-3X) between aio=threads,cache=unsafe and aio=native,cache=unsafe
>>>
>>> aio=threads is much faster, i guest there is conflict between "autodefrag" and linux aio
>> This is odd. The point is that with cache=unsafe it shouldn't even be
>> using Linux AIO in the first place. I can't see why there would be any
>> difference between aio=threads and aio=native with cache=unsafe.
>>
>> Kevin
>>
>
> is it possible to check the open mode of file and whether it is using aio at runtime?
You can attach strace and look for open/pwritev/iosubmit and friends. I
did that yesterday with qemu-io and didn't see any iosubmit for 'qemu-io
-k -t unsafe'.
Kevin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] linux aio and cache mode
2012-09-26 7:51 ` Kevin Wolf
@ 2012-09-28 0:00 ` ching
0 siblings, 0 replies; 7+ messages in thread
From: ching @ 2012-09-28 0:00 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel
On 09/26/2012 03:51 PM, Kevin Wolf wrote:
> Am 26.09.2012 01:22, schrieb ching:
>> On 09/25/2012 09:33 PM, Kevin Wolf wrote:
>>> Am 25.09.2012 00:40, schrieb ching:
>>>> On 09/24/2012 08:30 PM, Kevin Wolf wrote:
>>>>> Am 24.09.2012 13:32, schrieb ching:
>>>>>> Hi all,
>>>>>>
>>>>>> My host is qemu-1.1.1 and x64 kernel 3.5.4. The guest is using aio="native"
>>>>>>
>>>>>> I am trying to use unsafe cache mode to boost i/o performance.
>>>>> aio=native requires the image to be opened with O_DIRECT, i.e.
>>>>> cache=none or cache=directsync. If you specify a different cache option,
>>>>> it will silently fall back to aio=threads.
>>>>>
>>>>> Kevin
>>>>>
>>>> will qemu log a entry for the silent fallback?
>>> No, that's why it's silent. :-)
>>>
>>>> Reason:
>>>>
>>>> I am testing sparse image on btrfs with mount option: rw,noatime,space_cache,autodefrag,inode_cache
>>>>
>>>> i encounter a speed difference (around 2X-3X) between aio=threads,cache=unsafe and aio=native,cache=unsafe
>>>>
>>>> aio=threads is much faster, i guest there is conflict between "autodefrag" and linux aio
>>> This is odd. The point is that with cache=unsafe it shouldn't even be
>>> using Linux AIO in the first place. I can't see why there would be any
>>> difference between aio=threads and aio=native with cache=unsafe.
>>>
>>> Kevin
>>>
>> is it possible to check the open mode of file and whether it is using aio at runtime?
> You can attach strace and look for open/pwritev/iosubmit and friends. I
> did that yesterday with qemu-io and didn't see any iosubmit for 'qemu-io
> -k -t unsafe'.
>
> Kevin
>
The output of strace when using aio=native:
open("XXXXXX", O_RDWR|O_CLOEXEC) = 14
However, i can no longer reproduce the problem the VM image is defragged, it is weird.
Anyway, thank you very much for your help.
ching
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-09-28 0:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-24 11:32 [Qemu-devel] linux aio and cache mode ching
2012-09-24 12:30 ` Kevin Wolf
2012-09-24 22:40 ` ching
2012-09-25 13:33 ` Kevin Wolf
2012-09-25 23:22 ` ching
2012-09-26 7:51 ` Kevin Wolf
2012-09-28 0:00 ` ching
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).