From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by dpdk.org (Postfix) with ESMTP id C294E68AF for ; Fri, 14 Nov 2014 07:47:08 +0100 (CET) Received: by mail-pd0-f175.google.com with SMTP id w10so1074949pde.34 for ; Thu, 13 Nov 2014 22:57:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=3bz+66xb5x4h3OU5kssXQqh7EMiYqtGAlgN96LofB2k=; b=YFPKNGiHBsVrNpTPcwEMygPweZdx0RcMzxlXONqPVGpjM4GL6SJTBhXlgzLBMSTTko mu0zYyi4gvzEo+o+vQPNPTrwTzzJf6lf5oAxJdsmhEN06PxUDhV+n8jEYnLgIALymp1n 5k2M5k+lHQu7uLL5rnw2CQnEWQWk+76ttiKqo0X1Tt2eZInkYoAj1UEgkLzUpvVgqBkx 1GDgTJW0DRPMej7NBuTyGCGoxieT0rbomxPG9nb+OQyOh3Qivv26qgumWM+eqdV/vvf8 rWgSVnWn1DH6PgpvUq2lf1hIuuzH01uF5T31snEcwLagV3RUrd9fwyo+JxB1kKb9MW9H ABTQ== X-Gm-Message-State: ALoCoQl5B605jjBECVI/y8xZXfYQnve1yq0Un+8kfEWPxXLVrQkiwiYiJ0Vz31wGEg+2PE3v7niT X-Received: by 10.70.33.1 with SMTP id n1mr8333867pdi.12.1415948230190; Thu, 13 Nov 2014 22:57:10 -0800 (PST) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id y2sm26621820pdp.31.2014.11.13.22.57.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Nov 2014 22:57:09 -0800 (PST) Message-ID: <5465A7C2.7080208@igel.co.jp> Date: Fri, 14 Nov 2014 15:57:06 +0900 From: Tetsuya Mukawa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Linhaifeng , "Xie, Huawei" 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> In-Reply-To: <54659361.6000702@huawei.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit 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 06:47:09 -0000 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. Here is my code and message from the code. --------------------------------------------- [code] --------------------------------------------- size = memory.regions[i].memory_size + memory.regions[i].mmap_offset; guest_mem = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fds[i], 0); fprintf(stderr, "region=%d, mmap=%p, size=%lu\n", i, guest_mem, size); g_assert(guest_mem != MAP_FAILED); ret = munmap(guest_mem, size); fprintf(stderr, "region=%d, munmap=%p, size=%lu, ret=%d\n", i, guest_mem, size, ret); --------------------------------------------- [messages] --------------------------------------------- region=0, mmap=0x2aaac0000000, size=6291456000 region=0, munmap=0x2aaac0000000, size=6291456000, ret=-1 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. Thanks, Tetsuya