From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 5500D7CBD for ; Mon, 19 Feb 2018 21:44:54 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C8E87C6BB; Mon, 19 Feb 2018 20:44:53 +0000 (UTC) Received: from [10.36.112.19] (ovpn-112-19.ams2.redhat.com [10.36.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB13E2026E04; Mon, 19 Feb 2018 20:44:52 +0000 (UTC) To: Jianfeng Tan , dev@dpdk.org Cc: yliu@fridaylinux.org References: <1518580892-32656-1-git-send-email-jianfeng.tan@intel.com> <1518580892-32656-5-git-send-email-jianfeng.tan@intel.com> From: Maxime Coquelin Message-ID: <161752fc-9dd8-f952-eb00-ff1cb6e5fbdd@redhat.com> Date: Mon, 19 Feb 2018 21:44:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1518580892-32656-5-git-send-email-jianfeng.tan@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 19 Feb 2018 20:44:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 19 Feb 2018 20:44:53 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH 4/4] vhost: avoid populate guest memory 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: Mon, 19 Feb 2018 20:44:54 -0000 Hi Jianfeng, On 02/14/2018 05:01 AM, Jianfeng Tan wrote: > It's not necessary to polulate guest memory from vhost side. > > Cc: maxime.coquelin@redhat.com > Cc: yliu@fridaylinux.org > > Signed-off-by: Jianfeng Tan > --- > lib/librte_vhost/vhost_user.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index 90ed211..9bd0391 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -644,6 +644,7 @@ vhost_user_set_mem_table(struct virtio_net *dev, struct VhostUserMsg *pmsg) > uint64_t mmap_offset; > uint64_t alignment; > uint32_t i; > + int populate; > int fd; > > if (dev->mem && !vhost_memory_changed(&memory, dev->mem)) { > @@ -714,8 +715,9 @@ vhost_user_set_mem_table(struct virtio_net *dev, struct VhostUserMsg *pmsg) > } > mmap_size = RTE_ALIGN_CEIL(mmap_size, alignment); > > + populate = (dev->dequeue_zero_copy) ? MAP_POPULATE : 0; > mmap_addr = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, > - MAP_SHARED | MAP_POPULATE, fd, 0); > + MAP_SHARED | populate, fd, 0); > > if (mmap_addr == MAP_FAILED) { > RTE_LOG(ERR, VHOST_CONFIG, > Wouldn't not populating all the guest memory have a bad impact on 0% acceptable loss use-cases? Thanks, Maxime