qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] sheepdog: implement direct write semantics


From: Liu Yuan
Subject: Re: [Qemu-devel] [PATCH] sheepdog: implement direct write semantics
Date: Tue, 08 Jan 2013 19:08:16 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 01/08/2013 06:51 PM, Kevin Wolf wrote:
> Am 08.01.2013 11:39, schrieb Liu Yuan:
>> On 01/08/2013 06:00 PM, Kevin Wolf wrote:
>>> Am 08.01.2013 10:45, schrieb Liu Yuan:
>>>> On 01/08/2013 05:40 PM, Stefan Hajnoczi wrote:
>>>>> Otherwise use sheepdog writeback and let QEMU block.c decide when to
>>>>> flush.  Never use sheepdog writethrough because it's redundant here.
>>>>
>>>> I don't get it. What do you mean by 'redundant'? If we use virtio &
>>>> sheepdog block driver, how can we specify writethrough mode for Sheepdog
>>>> cache? Here 'writethrough' means use a pure read cache, which doesn't
>>>> need flush at all.
>>>
>>> A writethrough cache is equivalent to a write-back cache where each
>>> write is followed by a flush. qemu makes sure to send these flushes, so
>>> there is no need use Sheepdog's writethrough mode.
>>
>> Implement writethrough as writeback + flush will cause considerable
>> overhead for network block device like Sheepdog: a single write request
>> will be executed as two requests: write + flush
> 
> Yeah, maybe we should have some kind of a FUA flag with write requests
> instead of sending a separate flush.
> 
>> This also explains why
>> I saw a regression about write performance: Old QEMU can issue multiple
>> write requests in one go, but now the requests are sent one by one (even
>> with cache=writeback set), which makes Sheepdog write performance drop a
>> lot. Is it possible to issue multiple requests in one go as old QEMU does?
> 
> Huh? We didn't change anything to that respect, or at least not that I'm
> aware of. qemu always only had single-request bdrv_co_writev, so if
> anything that batching must have happened inside Sheepdog code? Do you
> know what makes it not batch requests any more?
> 

QEMU v1.1.x works well with batched write requests. Sheepdog block
driver doesn't do batching trick as far as I know, just send request as
it is feed. There isn't noticeable changes between v1.1.x and current
master regard to Sheepdog.c.

To detail the different behavior, from Sheepdog daemon which receives
the requests from QEMU:
 old: can receive multiple many requests at the virtually the same time
and handle them concurrently
 now: only receive one request, handle it, reply and get another.

So I think the problem is, current QEMU will wait for write response
before sending another request.

>> It seems it is hard to restore into old semantics of cache flags due to
>> new design of QEMU block layer. So will you accept that adding a 'flags'
>> into BlockDriverState which carry the 'cache flags' from user to keep
>> backward compatibility?
> 
> No, going back to the old behaviour would break guest-toggled WCE.
> 

Guest-toggled WCE only works with IDE and seems that virtio-blk doesn't
support it, no? And I think there are huge virtio-blk users.

I didn't meant to break WCE. What I meant is to allow backward
compatibility. For e.g, Sheepdog driver can make use of this dedicated
cache flags to implement its own cache control and doesn't affect other
drivers at all.

Thanks,
Yuan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]