From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id F03DB5913 for ; Tue, 12 Jan 2016 10:12:18 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 12 Jan 2016 01:12:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,556,1444719600"; d="scan'208,217";a="888753474" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.119]) ([10.239.67.119]) by orsmga002.jf.intel.com with ESMTP; 12 Jan 2016 01:12:15 -0800 To: Rich Lane References: <1446748276-132087-1-git-send-email-jianfeng.tan@intel.com> <1452426182-86851-1-git-send-email-jianfeng.tan@intel.com> <1452426182-86851-3-git-send-email-jianfeng.tan@intel.com> From: "Tan, Jianfeng" Message-ID: <5694C36D.2040006@intel.com> Date: Tue, 12 Jan 2016 17:12:13 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: nakajima.yoshihiro@lab.ntt.co.jp, "Michael S. Tsirkin" , dev@dpdk.org, ann.zhuangyanying@huawei.com Subject: Re: [dpdk-dev] [PATCH 2/4] mem: add API to obstain memory-backed file info 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: Tue, 12 Jan 2016 09:12:19 -0000 Hi! On 1/12/2016 4:26 AM, Rich Lane wrote: > On Sun, Jan 10, 2016 at 3:43 AM, Jianfeng Tan > wrote: > > @@ -1157,6 +1180,20 @@ rte_eal_hugepage_init(void) > mcfg->memseg[0].len = internal_config.memory; > mcfg->memseg[0].socket_id = socket_id; > > + hugepage = > create_shared_memory(eal_hugepage_info_path(), > + sizeof(struct hugepage_file)); > + hugepage->orig_va = addr; > + hugepage->final_va = addr; > + hugepage->physaddr = rte_mem_virt2phy(addr); > + hugepage->size = pagesize; > > > Should this be "hugepage->size = internal_config.memory"? Otherwise > the vhost-user > memtable entry has a size of only 2MB. I don't think so. See the definition: 47 struct hugepage_file { 48 void *orig_va; /**< virtual addr of first mmap() */ 49 void *final_va; /**< virtual addr of 2nd mmap() */ 50 uint64_t physaddr; /**< physical addr */ 51 size_t size; /**< the page size */ 52 int socket_id; /**< NUMA socket ID */ 53 int file_id; /**< the '%d' in HUGEFILE_FMT */ 54 int memseg_id; /**< the memory segment to which page belongs */ 55 #ifdef RTE_EAL_SINGLE_FILE_SEGMENTS 56 int repeated; /**< number of times the page size is repeated */ 57 #endif 58 char filepath[MAX_HUGEPAGE_PATH]; /**< path to backing file on filesystem */ 59 }; size stands for the page size instead of total size. Thanks, Jianfeng