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 ABCF05934 for ; Thu, 19 Nov 2015 07:32:09 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 18 Nov 2015 22:32:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,317,1444719600"; d="scan'208";a="823781174" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 18 Nov 2015 22:32:09 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 18 Nov 2015 22:32:08 -0800 Received: from shsmsx152.ccr.corp.intel.com ([169.254.6.193]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.88]) with mapi id 14.03.0248.002; Thu, 19 Nov 2015 14:32:06 +0800 From: "Wang, Zhihong" To: "Xie, Huawei" , Stephen Hemminger , "Richardson, Bruce" Thread-Topic: [dpdk-dev] [RFC PATCH 2/2] lib/librte_eal: Remove unnecessary hugepage zero-filling Thread-Index: AQHRIho/3S9e7wUFHEmngptQDeHOr56i4tzw Date: Thu, 19 Nov 2015 06:32:05 +0000 Message-ID: <8F6C2BD409508844A0EFC19955BE0941834B7D@SHSMSX152.ccr.corp.intel.com> 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> In-Reply-To: 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:32:10 -0000 > -----Original Message----- > From: Xie, Huawei > Sent: Thursday, November 19, 2015 2:05 PM > To: Wang, Zhihong ; Stephen Hemminger > ; Richardson, Bruce > > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [RFC PATCH 2/2] lib/librte_eal: Remove unnecessar= y > hugepage zero-filling >=20 > On 11/19/2015 10:16 AM, Wang, Zhihong wrote: > > > >> -----Original Message----- > >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen > >> Hemminger > >> Sent: Thursday, November 19, 2015 3:09 AM > >> To: Richardson, Bruce > >> Cc: dev@dpdk.org > >> Subject: Re: [dpdk-dev] [RFC PATCH 2/2] lib/librte_eal: Remove > >> unnecessary hugepage zero-filling > >> > >> On Wed, 18 Nov 2015 16:13:32 +0000 > >> "Richardson, Bruce" wrote: > >> > >>> > >>>> -----Original Message----- > >>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen > >>>> Hemminger > >>>> Sent: Wednesday, November 18, 2015 4:00 PM > >>>> To: Xie, Huawei > >>>> Cc: dev@dpdk.org > >>>> Subject: Re: [dpdk-dev] [RFC PATCH 2/2] lib/librte_eal: Remove > >>>> unnecessary hugepage zero-filling > >>>> > >>>> On Wed, 18 Nov 2015 12:07:54 +0000 > >>>> "Xie, Huawei" wrote: > >>>> > >>>>>>>> The kernel fills new allocated (huge) pages with zeros. > >>>>>>>> DPDK just has to touch the pages to trigger the allocation. > >>>>> I think we shouldn't reply on the assumption that kernel has > >>>>> zeroed the memory. Kernel zeroes the memory mostly to avoid > >>>>> information leakage.It could also achieve this by setting each bit = to 1. > >>>>> What we indeed need to check is later DPDK initialization code > >>>>> doesn't assume the memory has been zeroed. Otherwise zero only > >>>>> that part of the memory. Does this makes sense? > >>>> If all new pages are zero, why does DPDK have to pre-touch the > >>>> pages at all? > >>> The pages won't actually be mapped into the processes address space > >>> until > >> accessed. > >>> /Bruce > >> Isn't that what mmap MAP_POPULATE flag (not currently used) will do. > > Yes, the MAP_POPULATE does literally the same thing. > > 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. :) > > > > I think we can use this flag since it makes the code clearer. > The manual says MAP_POPULATE is only supported for private mappings since > Linux 2.6.23. I've done check before and MAP_SHARED | MAP_POPULATE worked together correc= tly. Is there any implicit complication here? > > > > /Zhihong > > > >