From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 4B20DD4E0; Wed, 16 May 2018 08:09:56 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2018 23:09:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,404,1520924400"; d="scan'208";a="41627510" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.203]) by orsmga008.jf.intel.com with ESMTP; 15 May 2018 23:09:54 -0700 Date: Wed, 16 May 2018 14:10:21 +0800 From: Tiwei Bie To: Maxime Coquelin Cc: dev@dpdk.org, jianfeng.tan@intel.com, mst@redhat.com, stable@dpdk.org Message-ID: <20180516061021.GA25485@debian> References: <20180430155954.9939-1-maxime.coquelin@redhat.com> <20180503115634.feaimkzpnbodferd@debian> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Subject: Re: [dpdk-dev] [PATCH] vhost: improve dirty pages logging performance X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 06:09:56 -0000 On Tue, May 15, 2018 at 03:50:54PM +0200, Maxime Coquelin wrote: > Hi Tiwei, > > I just see I missed to reply to your comment on my commit message: > > On 05/03/2018 01:56 PM, Tiwei Bie wrote: > > On Mon, Apr 30, 2018 at 05:59:54PM +0200, Maxime Coquelin wrote: > > > This patch caches all dirty pages logging until the used ring index > > > is updated. These dirty pages won't be accessed by the guest as > > > long as the host doesn't give them back to it by updating the > > > index. > > Below sentence in above commit message isn't the reason why > > we can cache the dirty page logging. Right? > > > > """ > > These dirty pages won't be accessed by the guest as > > long as the host doesn't give them back to it by updating the > > index. > > That's my understanding. > As long as the used index is not updated, the guest will not process > the descs. > If the migration converges between the time the descs are written, > and the time the used index is updated on source side. Then the guest > running on destination will not see the descriptors as used but as > available, and so will be overwritten by the vhost backend on > destination. If my understanding is correct, theoretically the vhost backend can cache all the dirty page loggings before it responds to the GET_VRING_BASE messages. Below are the steps how QEMU live migration works (w/o postcopy): 1. Syncing dirty pages between src and dst; 2. The dirty page sync converges; 3. The src QEMU sends GET_VRING_BASE to vhost backend; 4. Vhost backend still has a chance to log some dirty pages before responding the GET_VRING_BASE messages; 5. The src QEMU receives GET_VRING_BASE response (which means the device has stopped); 6. QEMU sync the remaining dirty pages; 7. QEMU on the dst starts running. (The steps 3~6 are the downtime which we want to minimize) So I think the words in commit log isn't really related to why we can cache the dirty page loggings. Best regards, Tiwei Bie > > Regards, > Maxime