From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:35700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkLHp-0003C3-1O for qemu-devel@nongnu.org; Thu, 17 Jan 2019 22:57:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkLHo-0000pm-2N for qemu-devel@nongnu.org; Thu, 17 Jan 2019 22:57:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50918) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gkLHn-0000VT-Pr for qemu-devel@nongnu.org; Thu, 17 Jan 2019 22:57:39 -0500 References: <20190109112728.9214-1-xieyongji@baidu.com> <20190109112728.9214-5-xieyongji@baidu.com> <20190117095848-mutt-send-email-mst@kernel.org> From: Jason Wang Message-ID: <0fd8d4f7-9cd5-0c8a-0b72-9834ec50264a@redhat.com> Date: Fri, 18 Jan 2019 11:57:15 +0800 MIME-Version: 1.0 In-Reply-To: <20190117095848-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 for-4.0 4/7] libvhost-user: Support tracking inflight I/O in shared memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Yongji Xie , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , "Coquelin, Maxime" , Yury Kotov , =?UTF-8?B?0JXQstCz0LXQvdC40Lkg0K/QutC+0LLQu9C10LI=?= , qemu-devel , zhangyu31@baidu.com, chaiwen@baidu.com, nixun@baidu.com, lilin24@baidu.com, Xie Yongji , Stefan Hajnoczi On 2019/1/17 =E4=B8=8B=E5=8D=8810:59, Michael S. Tsirkin wrote: > On Thu, Jan 17, 2019 at 05:57:29PM +0800, Jason Wang wrote: >> On 2019/1/15 =E4=B8=8B=E5=8D=8810:51, Yongji Xie wrote: >>>> Well, this may work but here're my points: >>>> >>>> 1) The code want to recover from backed crash by introducing extra s= pace >>>> to store inflight data, but it still depends on the backend to set/g= et >>>> the inflight state >>>> >>>> 2) Since the backend could be killed at any time, the backend must h= ave >>>> the ability to recover from the partial inflight state >>>> >>>> So it looks to me 1) tends to be self-contradictory and 2) tends to = be >>>> recursive. The above lines show how tricky could the code looks like= . >>>> >>>> Solving this at vhost-user level through at backend is probably wron= g. >>>> It's time to consider the support from virtio itself. >>>> >>> I agree that supporting this in virtio level may be better. For >>> example, resubmitting inflight I/O once DEVICE_NEEDS_RESET is set in >>> Stefan's proposal. But I still think QEMU should be able to provide >>> this ability too. Supposed that one vhost-user backend need to suppor= t >>> multiple VMs. We can't enable reconnect ability until all VMs' guest >>> driver support the new feature. It's limited. >> >> That's the way virtio evolves. >> >> >>> But if QEMU have the >>> ability to store inflight buffer, the backend could at least have a >>> chance to support this case. >> >> The problem is, you need a careful designed protocol described somewhe= re (is >> vhost-user.txt a good place for this?). And this work will be (partial= ) >> duplicated for the future support from virtio spec itself. >> >> >>> Maybe backend could have other way to >>> avoid the tricky code. >> >> I'm not sure, but it was probably not easy. > I see an implementation in libvhost-user. > > Do you see an issue there? I've asked some questions in this thread, it looks like we can still=20 miss some inflight descriptors. Thanks > > >> Thanks >> >> >>> Thanks,