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 3C11C8E6C for ; Mon, 23 Nov 2015 03:54:59 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 22 Nov 2015 18:54:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,335,1444719600"; d="scan'208";a="692227726" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 22 Nov 2015 18:54:57 -0800 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 22 Nov 2015 18:54:57 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 22 Nov 2015 18:54:56 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.83]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.88]) with mapi id 14.03.0248.002; Mon, 23 Nov 2015 10:54:55 +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: Mon, 23 Nov 2015 02:54:54 +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> <8F6C2BD409508844A0EFC19955BE0941834B7D@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: Mon, 23 Nov 2015 02:54:59 -0000 On 11/19/2015 2:32 PM, Wang, Zhihong wrote:=0A= >> -----Original Message-----=0A= >> From: Xie, Huawei=0A= >> Sent: Thursday, November 19, 2015 2:05 PM=0A= >> To: Wang, Zhihong ; Stephen Hemminger=0A= >> ; Richardson, Bruce=0A= >> =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 11/19/2015 10:16 AM, Wang, Zhihong wrote:=0A= >>>> -----Original Message-----=0A= >>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen=0A= >>>> 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=0A= >>>> unnecessary hugepage zero-filling=0A= >>>>=0A= >>>> On Wed, 18 Nov 2015 16:13:32 +0000=0A= >>>> "Richardson, Bruce" wrote:=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=0A= >>>>>> pages at all?=0A= >>>>> The pages won't actually be mapped into the processes address space= =0A= >>>>> until=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=0A= >>> page, guess that's why DPDK fault the page tables manually in the=0A= >>> 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 sinc= e=0A= >> Linux 2.6.23.=0A= > I've done check before and MAP_SHARED | MAP_POPULATE worked together corr= ectly. Is there any implicit complication here?=0A= I checked shared mapping with MAP_POPULATE between two processes. It=0A= works. Then i did some search, find the manual is also ambiguous to=0A= others and thus have been changed, :).=0A= Before: MAP_POPULATE is only supported for private mappings since Linux=0A= 2.6.23.=0A= After: MAP_POPULATE is supported for private mappings only since Linux=0A= 2.6.23.=0A= http://stackoverflow.com/questions/23502361/linux-mmap-with-map-populate-ma= n-page-seems-to-give-wrong-info=0A= >=0A= >>> /Zhihong=0A= >>>=0A= >>>=0A= >=0A= =0A=