From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id CEED87E75 for ; Fri, 14 Nov 2014 11:54:02 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 14 Nov 2014 03:01:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,385,1413270000"; d="scan'208";a="607775934" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga001.jf.intel.com with ESMTP; 14 Nov 2014 03:03:58 -0800 Received: from pgsmsx105.gar.corp.intel.com (10.221.44.96) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 14 Nov 2014 18:59:31 +0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by pgsmsx105.gar.corp.intel.com (10.221.44.96) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 14 Nov 2014 18:59:31 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.5]) with mapi id 14.03.0195.001; Fri, 14 Nov 2014 18:59:29 +0800 From: "Xie, Huawei" To: Tetsuya Mukawa , Linhaifeng Thread-Topic: [dpdk-dev] vhost-user technical isssues Thread-Index: Ac/997srCGFXGQlUQCu5VHdgBPnJPgB4If7FAAfpBDA= Date: Fri, 14 Nov 2014 10:59:29 +0000 Message-ID: References: <5462DE39.1070006@igel.co.jp> <54645007.3010301@huawei.com> <54656950.1050204@igel.co.jp> <54657365.7090504@huawei.com> <546579A3.3010804@igel.co.jp> <54658853.2090100@huawei.com> <54658F55.4070409@igel.co.jp> <54659361.6000702@huawei.com> <5465A7C2.7080208@igel.co.jp> In-Reply-To: <5465A7C2.7080208@igel.co.jp> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] vhost-user technical isssues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2014 10:54:03 -0000 I tested with latest qemu(with offset fix) in vhost app(not with test case)= , unmap succeeds only when the size is aligned to 1GB(hugepage size). Another important thing is could we do mmap(0, region[i].memory_size, PROT= _XX, mmap_offset) rather than with offset 0? With the region above 4GB, we = will waste 4GB address space. Or we at least need to round down offset to n= earest 1GB, and round up memory size to upper 1GB, to save some address spa= ce waste. Anyway, this is ugly. Kernel doesn't take care of us, do those alignment fo= r us automatically. > -----Original Message----- > From: Tetsuya Mukawa [mailto:mukawa@igel.co.jp] > Sent: Thursday, November 13, 2014 11:57 PM > To: Linhaifeng; Xie, Huawei > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] vhost-user technical isssues >=20 > Hi Lin, > (2014/11/14 14:30), Linhaifeng wrote: > > > > On 2014/11/14 13:12, Tetsuya Mukawa wrote: > >> ease try another value like 6000MB > > i have try this value 6000MB.I can munmap success. > > > > you mmap with size "memory_size + memory_offset" should also munmap > with this size. > > > I appreciate for your testing and sugesstions. :) > I am not sure what is difference between your environment and my > environment. >=20 > Here is my code and message from the code. > --------------------------------------------- > [code] > --------------------------------------------- > size =3D memory.regions[i].memory_size + memory.regions[i].mmap_offset; >=20 > guest_mem =3D mmap(0, size, PROT_READ | PROT_WRITE, > MAP_SHARED, fds[i], 0); >=20 > fprintf(stderr, "region=3D%d, mmap=3D%p, size=3D%lu\n", i, guest_mem, siz= e); >=20 > g_assert(guest_mem !=3D MAP_FAILED); >=20 > ret =3D munmap(guest_mem, size); >=20 > fprintf(stderr, "region=3D%d, munmap=3D%p, size=3D%lu, ret=3D%d\n", > i, guest_mem, size, ret); >=20 > --------------------------------------------- > [messages] > --------------------------------------------- > region=3D0, mmap=3D0x2aaac0000000, size=3D6291456000 > region=3D0, munmap=3D0x2aaac0000000, size=3D6291456000, ret=3D-1 >=20 > With your environment, 'ret' will be 0. > In my environment, 'size' should be aligned not to get error. > Anyway, it's nice to implement more simple. > When munmap failure occurs, let's think it again. >=20 > Thanks, > Tetsuya