From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bruce.richardson@intel.com>
Received: from mga01.intel.com (mga01.intel.com [192.55.52.88])
 by dpdk.org (Postfix) with ESMTP id 8A2EE5A6C
 for <dev@dpdk.org>; Fri, 20 Nov 2015 13:15:47 +0100 (CET)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by fmsmga101.fm.intel.com with ESMTP; 20 Nov 2015 04:15:46 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.20,322,1444719600"; d="scan'208";a="825070014"
Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.60])
 by orsmga001.jf.intel.com with SMTP; 20 Nov 2015 04:15:44 -0800
Received: by  (sSMTP sendmail emulation); Fri, 20 Nov 2015 12:15:43 +0025
Date: Fri, 20 Nov 2015 12:15:43 +0000
From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Message-ID: <20151120121543.GA2528@bricha3-MOBL3>
References: <1447817231-10510-1-git-send-email-zhihong.wang@intel.com>
 <1447817231-10510-3-git-send-email-zhihong.wang@intel.com>
 <B27915DBBA3421428155699D51E4CFE2023BE52A@IRSMSX103.ger.corp.intel.com>
 <8F6C2BD409508844A0EFC19955BE094183467C@SHSMSX152.ccr.corp.intel.com>
 <C37D651A908B024F974696C65296B57B4B198CF8@SHSMSX101.ccr.corp.intel.com>
 <20151118080013.3cad8f5b@samsung9>
 <59AF69C657FD0841A61C55336867B5B035985B24@IRSMSX103.ger.corp.intel.com>
 <20151118110906.3e0b3dcd@samsung9>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20151118110906.3e0b3dcd@samsung9>
Organization: Intel Shannon Ltd.
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: "dev@dpdk.org" <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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Nov 2015 12:15:48 -0000

On Wed, Nov 18, 2015 at 11:09:06AM -0800, Stephen Hemminger wrote:
> On Wed, 18 Nov 2015 16:13:32 +0000
> "Richardson, Bruce" <bruce.richardson@intel.com> 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 <huawei.xie@intel.com>
> > > 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" <huawei.xie@intel.com> 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.

Hadn't seen that flag before, but it does indeed look to do exactly what we
want.

/Bruce