From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id CFAE68E81 for ; Fri, 22 Jan 2016 03:08:15 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 21 Jan 2016 18:08:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,328,1449561600"; d="scan'208";a="638391739" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.119]) ([10.239.67.119]) by FMSMGA003.fm.intel.com with ESMTP; 21 Jan 2016 18:07:58 -0800 To: Tetsuya Mukawa , dev@dpdk.org, yuanhan.liu@linux.intel.com References: <1453108389-21006-2-git-send-email-mukawa@igel.co.jp> <1453374478-30996-5-git-send-email-mukawa@igel.co.jp> <56A18958.7070202@intel.com> From: "Tan, Jianfeng" Message-ID: <56A18EFE.5050600@intel.com> Date: Fri, 22 Jan 2016 10:07:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56A18958.7070202@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC PATCH 4/5] EAL: Add new EAL "--shm" option. 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, 22 Jan 2016 02:08:16 -0000 Hi Tetsuya, On 1/22/2016 9:43 AM, Tan, Jianfeng wrote: > Hi Tetsuya, > > On 1/21/2016 7:07 PM, Tetsuya Mukawa wrote: >> This is a temporary patch to get EAL memory under 16T(1 << 44). >> >> The patch adds new EAL "--shm" option. If the option is specified, >> EAL will allocate one file from hugetlbfs. This memory is for sharing >> memory between DPDK applicaiton and QEMU ivhsmem device. >> >> Signed-off-by: Tetsuya Mukawa >> --- >> lib/librte_eal/common/eal_common_options.c | 5 ++ >> lib/librte_eal/common/eal_internal_cfg.h | 1 + >> lib/librte_eal/common/eal_options.h | 2 + >> lib/librte_eal/common/include/rte_memory.h | 5 ++ >> lib/librte_eal/linuxapp/eal/eal_memory.c | 76 >> ++++++++++++++++++++++++++++++ >> 5 files changed, 89 insertions(+) >> > ... >> + vaddr = mmap((void *)(1ULL << 43), size, PROT_READ | PROT_WRITE, >> + MAP_SHARED | MAP_FIXED, fd, 0); >> + if (vaddr != MAP_FAILED) { >> + memset(vaddr, 0, size); >> + *pfd = fd; >> + } > > I'm not sure if hard-coded way is good enough. It's known that kernel > manages VMAs using red-black tree, but I don't know if kernel > allocates VMA from low address to high address (if yes, can we > leverage this feature?). > A little more:it seems that kernel uses arch_get_unmapped_area_topdown() -> unmapped_area_topdown() to do that, which starts at mm->highest_vm_end. If this value bigger than (1ULL << 44)? Thanks, Jianfeng