From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 65F098D91 for ; Wed, 18 Nov 2015 11:29:46 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 18 Nov 2015 02:29:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,312,1444719600"; d="scan'208";a="602447457" Received: from unknown (HELO dpdk5.sh.intel.com) ([10.239.129.244]) by FMSMGA003.fm.intel.com with ESMTP; 18 Nov 2015 02:29:44 -0800 From: Zhihong Wang To: dev@dpdk.org Date: Tue, 17 Nov 2015 22:27:11 -0500 Message-Id: <1447817231-10510-3-git-send-email-zhihong.wang@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1447817231-10510-1-git-send-email-zhihong.wang@intel.com> References: <1447817231-10510-1-git-send-email-zhihong.wang@intel.com> Subject: [dpdk-dev] [RFC PATCH 2/2] lib/librte_eal: Remove unnecessary hugepage zero-filling 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: Wed, 18 Nov 2015 10:29:46 -0000 The kernel fills new allocated (huge) pages with zeros. DPDK just has to touch the pages to trigger the allocation. Signed-off-by: Zhihong Wang --- lib/librte_eal/linuxapp/eal/eal_memory.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index 0de75cd..af823dc 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -410,7 +410,7 @@ map_all_hugepages(struct hugepage_file *hugepg_tbl, if (orig) { hugepg_tbl[i].orig_va = virtaddr; - memset(virtaddr, 0, hugepage_sz); + memset(virtaddr, 0, 8); } else { hugepg_tbl[i].final_va = virtaddr; @@ -592,9 +592,6 @@ remap_all_hugepages(struct hugepage_file *hugepg_tbl, struct hugepage_info *hpi) } } - /* zero out the whole segment */ - memset(hugepg_tbl[page_idx].final_va, 0, total_size); - page_idx++; } -- 2.5.0