From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] vhost: fix mem share between VM and host Date: Sun, 10 Apr 2016 21:44:16 +0200 Message-ID: <2695247.7xaK7GTsXK@xps13> References: <1460309332-21981-1-git-send-email-zhe.tao@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Zhe Tao Return-path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 48D802956 for ; Sun, 10 Apr 2016 21:44:18 +0200 (CEST) Received: by mail-wm0-f44.google.com with SMTP id n3so79645319wmn.0 for ; Sun, 10 Apr 2016 12:44:18 -0700 (PDT) In-Reply-To: <1460309332-21981-1-git-send-email-zhe.tao@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-04-11 01:28, Zhe Tao: > The reason cause this problem is that in QEMU, when assign the > memory-backend-file without share option, will cause QEMU mmap the mem file > without using the MAP_SHARED flag, so the page cache for that file will not > shared between other processes, all the upated to the mapping area in the VM > will not carry through to the vhost-user process. > > According to kernel implementation, data for the new hugetlbfs file will be > all zero, so check the first RX virtqueue descriptor next field to see > whether the mem is shared or not, if the mem is shared, the next field should > not equal to zero, otherwise this mem is not shared between VM and host. I failed to understand. Please try to do some short sentences and start by explaining what is the bug you see. Then you can start explain the root cause and how it can be fixed (using some short sentences). I also think it is too late to integrate such code change in 16.04 (even if I don't understand how important it is).