qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Liu Yuan <namei.unix@gmail.com>
To: Vasiliy Tolstov <v.tolstov@selfip.ru>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Teruaki Ishizaki <ishizaki.teruaki@lab.ntt.co.jp>,
	Hitoshi Mitake <mitake.hitoshi@gmail.com>,
	Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>,
	Jeff Cody <jcody@redhat.com>,
	qemu-devel@nongnu.org, sheepdog-ng@googlegroups.com,
	morita.kazutaka@gmail.com, Stefan Hajnoczi <stefanha@redhat.com>,
	sheepdog@lists.wpkg.org
Subject: Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: fix overlapping metadata update
Date: Sun, 2 Aug 2015 10:06:11 +0800	[thread overview]
Message-ID: <20150802020611.GA11733@ubuntu-trusty> (raw)
In-Reply-To: <CACaajQumYg7iVu61RBrrtS6syx728UvCWpQn4o+0oPC4x984LQ@mail.gmail.com>

On Fri, Jul 31, 2015 at 03:08:09PM +0300, Vasiliy Tolstov wrote:
> 2015-07-31 14:55 GMT+03:00 Vasiliy Tolstov <v.tolstov@selfip.ru>:
> > Liu's patch also works for me. But also like in Hitoshi patch breaks
> > when using discards in qemu =(.
> 
> 
> Please wait to performance comparison. As i see Liu's patch may be
> more slow then Hitoshi.
> 

Thanks for your time! Well, as far as I know, my patch would be slightly better
in performance wise because it preserves the parallelism of requests. Due to
scatter gather IO requests characteristics, we could assume following IO pattern
as an illustration:

req1 is split into 2 sheep reqs:
create(2), create(10)

req2 is split into 2 sheep reqs:
create(5), create(100)

So there are finally 4 sheep requests and with my patch they will be run in
parallel by sheep cluster and only 4 unref of objects will be executed
internally: update_inode(2), update_inode(10), update_inode(5), update_inode(100)

With Hitoshi's patch, however, req1 and req2 will be serialized and only one req
is finished then the other one will be sent to sheep and there are 9+96=105 unref
of objects will be executed internally. There are still chances data corruption
because update_inode(2,10) and update_inode(5,100) will both update the range
[5,10], which is a potential problem if the overlapped range has different values
when the requests are queued with stale data.

This is really a several years bug: we should update the inode bits exactly as
we create the objects, not update the bits we don't touch at all. This bug isn't
revealed for a long time because most of the time, min == max in
create_inode(min, max) and before we introduction of generation reference counting
to the snapshot reference mechanism, updating inode bit with 0 won't cause a
remove request in sheepdog.

I'm also concerned with the complete new mechanism since current request handling
mechanism is solid as time goes by. It exists for years. The complete new stuff
might need a long time to stablize and need to fix the possible side effect we
don't know yet.

Thanks,
Yuan

  reply	other threads:[~2015-08-02  2:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29  4:02 [Qemu-devel] [PATCH] sheepdog: fix overlapping metadata update Liu Yuan
2015-07-29  5:04 ` [Qemu-devel] [sheepdog] " Hitoshi Mitake
2015-07-29  9:31   ` Liu Yuan
2015-07-30  6:41     ` Vasiliy Tolstov
2015-07-30  9:13       ` Liu Yuan
2015-07-30  9:29         ` Vasiliy Tolstov
2015-07-30 13:27       ` Jeff Cody
2015-07-31 11:55         ` Vasiliy Tolstov
2015-07-31 12:08           ` Vasiliy Tolstov
2015-08-02  2:06             ` Liu Yuan [this message]
2015-08-02 11:52             ` Vasiliy Tolstov
2015-08-02 12:07               ` Vasiliy Tolstov
2015-08-03  0:41               ` Liu Yuan
2015-08-04  8:07                 ` Vasiliy Tolstov
2015-08-05 18:58                   ` Jeff Cody
2015-08-09 14:03                     ` Vasiliy Tolstov
2015-08-10 10:44                       ` Stefan Hajnoczi
2015-08-03  2:01         ` Liu Yuan

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=20150802020611.GA11733@ubuntu-trusty \
    --to=namei.unix@gmail.com \
    --cc=ishizaki.teruaki@lab.ntt.co.jp \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mitake.hitoshi@gmail.com \
    --cc=mitake.hitoshi@lab.ntt.co.jp \
    --cc=morita.kazutaka@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sheepdog-ng@googlegroups.com \
    --cc=sheepdog@lists.wpkg.org \
    --cc=stefanha@redhat.com \
    --cc=v.tolstov@selfip.ru \
    /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).