qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Liu Yuan <namei.unix@gmail.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org,
	MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] sheepdog: implement direct write semantics
Date: Tue, 08 Jan 2013 19:08:16 +0800	[thread overview]
Message-ID: <50EBFE20.9010100@gmail.com> (raw)
In-Reply-To: <50EBFA3F.8030808@redhat.com>

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	other threads:[~2013-01-08 11:08 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19 18:29 [Qemu-devel] [PATCH] sheepdog: implement direct write semantics Liu Yuan
2012-12-25  7:47 ` MORITA Kazutaka
2012-12-25  8:26   ` Liu Yuan
2012-12-25  8:45   ` Liu Yuan
2013-01-03 13:43     ` Liu Yuan
2013-01-04 16:38       ` Stefan Hajnoczi
2013-01-05  4:40         ` Liu Yuan
2013-01-05  5:29           ` Liu Yuan
2013-01-05  7:56             ` Liu Yuan
2013-01-07 12:31               ` Stefan Hajnoczi
2013-01-08  5:28                 ` Liu Yuan
2013-01-07 13:23               ` Kevin Wolf
2013-01-08  5:42                 ` Liu Yuan
2013-01-08  9:40                   ` Stefan Hajnoczi
2013-01-08  9:45                     ` Liu Yuan
2013-01-08 10:00                       ` Kevin Wolf
2013-01-08 10:39                         ` Liu Yuan
2013-01-08 10:51                           ` Kevin Wolf
2013-01-08 11:08                             ` Liu Yuan [this message]
2013-01-08 11:19                               ` Kevin Wolf
2013-01-08 11:35                                 ` Liu Yuan
2013-01-08 12:12                                   ` Kevin Wolf
2013-01-08 13:18                                     ` Liu Yuan
2013-01-08 13:23                                       ` Liu Yuan
2013-01-09 10:25                                       ` Paolo Bonzini
2013-01-09 10:36                                         ` Liu Yuan
2013-01-09 10:40                                           ` Paolo Bonzini
2013-01-09 10:46                                             ` Liu Yuan
2013-01-09 10:58                                               ` Liu Yuan
2013-01-09 11:10                                                 ` Paolo Bonzini
2013-01-09 12:07                                               ` Liu Yuan
2013-01-09 12:10                                                 ` Liu Yuan
2013-01-09 12:16                                                 ` Liu Yuan
2013-01-09 12:42                                                 ` Kevin Wolf
2013-01-09 13:04                                                   ` Liu Yuan
2013-01-09 15:10                                                     ` Paolo Bonzini
2013-01-10  5:38                                                       ` Liu Yuan
2013-01-11  7:52                                                         ` MORITA Kazutaka
2013-01-11  8:07                                                           ` Liu Yuan
2013-01-11  9:00                                                             ` Paolo Bonzini
2013-01-11  9:04                                                               ` Liu Yuan
2013-01-11  9:34                                                                 ` Paolo Bonzini
2013-01-11  9:38                                                                   ` Liu Yuan
2013-01-11  9:40                                                                     ` Paolo Bonzini
2013-01-11  9:32                                                           ` Kevin Wolf
2013-01-10 15:25                                                       ` Jamie Lokier
2013-01-10 15:31                                                         ` Paolo Bonzini
2013-01-10 17:22                                                           ` Jamie Lokier
2013-01-09 11:10                                           ` Kevin Wolf
2013-01-09 10:23                                     ` Paolo Bonzini
2013-01-10 15:12                             ` Jamie Lokier
2013-01-10 15:21                               ` Kevin Wolf
2013-01-10  8:03 ` [Qemu-devel] [PATCH v2] " Liu Yuan
2013-01-10  9:04   ` Stefan Hajnoczi
2013-01-11  7:35   ` MORITA Kazutaka
2013-01-11  9:23     ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50EBFE20.9010100@gmail.com \
    --to=namei.unix@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=morita.kazutaka@lab.ntt.co.jp \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).