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 5027A5A35 for ; Thu, 19 Nov 2015 07:05:00 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 18 Nov 2015 22:04:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,316,1444719600"; d="scan'208";a="854307868" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 18 Nov 2015 22:05:00 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 18 Nov 2015 22:04:58 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 18 Nov 2015 22:04:58 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.83]) by shsmsx102.ccr.corp.intel.com ([169.254.2.42]) with mapi id 14.03.0248.002; Thu, 19 Nov 2015 14:04:56 +0800 From: "Xie, Huawei" To: "Wang, Zhihong" , Stephen Hemminger , "Richardson, Bruce" Thread-Topic: [dpdk-dev] [RFC PATCH 2/2] lib/librte_eal: Remove unnecessary hugepage zero-filling Thread-Index: AQHRIpA2Zgd66+AuZ0yzNvbxLHxMhg== Date: Thu, 19 Nov 2015 06:04:56 +0000 Message-ID: References: <1447817231-10510-1-git-send-email-zhihong.wang@intel.com> <1447817231-10510-3-git-send-email-zhihong.wang@intel.com> <8F6C2BD409508844A0EFC19955BE094183467C@SHSMSX152.ccr.corp.intel.com> <20151118080013.3cad8f5b@samsung9> <59AF69C657FD0841A61C55336867B5B035985B24@IRSMSX103.ger.corp.intel.com> <20151118110906.3e0b3dcd@samsung9> <8F6C2BD409508844A0EFC19955BE0941834A76@SHSMSX152.ccr.corp.intel.com> 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] [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: Thu, 19 Nov 2015 06:05:00 -0000 On 11/19/2015 10:16 AM, Wang, Zhihong wrote:=0A= >=0A= >> -----Original Message-----=0A= >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger= =0A= >> Sent: Thursday, November 19, 2015 3:09 AM=0A= >> To: Richardson, Bruce =0A= >> Cc: dev@dpdk.org=0A= >> Subject: Re: [dpdk-dev] [RFC PATCH 2/2] lib/librte_eal: Remove unnecessa= ry=0A= >> hugepage zero-filling=0A= >>=0A= >> On Wed, 18 Nov 2015 16:13:32 +0000=0A= >> "Richardson, Bruce" wrote:=0A= >>=0A= >>>=0A= >>>> -----Original Message-----=0A= >>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen=0A= >>>> Hemminger=0A= >>>> Sent: Wednesday, November 18, 2015 4:00 PM=0A= >>>> To: Xie, Huawei =0A= >>>> Cc: dev@dpdk.org=0A= >>>> Subject: Re: [dpdk-dev] [RFC PATCH 2/2] lib/librte_eal: Remove=0A= >>>> unnecessary hugepage zero-filling=0A= >>>>=0A= >>>> On Wed, 18 Nov 2015 12:07:54 +0000=0A= >>>> "Xie, Huawei" wrote:=0A= >>>>=0A= >>>>>>>> The kernel fills new allocated (huge) pages with zeros.=0A= >>>>>>>> DPDK just has to touch the pages to trigger the allocation.=0A= >>>>> I think we shouldn't reply on the assumption that kernel has=0A= >>>>> zeroed the memory. Kernel zeroes the memory mostly to avoid=0A= >>>>> information leakage.It could also achieve this by setting each bit to= 1.=0A= >>>>> What we indeed need to check is later DPDK initialization code=0A= >>>>> doesn't assume the memory has been zeroed. Otherwise zero only=0A= >>>>> that part of the memory. Does this makes sense?=0A= >>>> If all new pages are zero, why does DPDK have to pre-touch the pages= =0A= >>>> at all?=0A= >>> The pages won't actually be mapped into the processes address space unt= il=0A= >> accessed.=0A= >>> /Bruce=0A= >> Isn't that what mmap MAP_POPULATE flag (not currently used) will do.=0A= > Yes, the MAP_POPULATE does literally the same thing.=0A= > This flag is implemented since Linux 2.5.46 according to Linux man page, = guess that's why DPDK fault the page tables manually in the first place. :)= =0A= >=0A= > I think we can use this flag since it makes the code clearer.=0A= The manual says MAP_POPULATE is only supported for private mappings=0A= since Linux 2.6.23.=0A= >=0A= > /Zhihong=0A= >=0A= >=0A= =0A=