From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [RFC PATCH 2/2] lib/librte_eal: Remove unnecessary hugepage zero-filling Date: Sun, 22 Nov 2015 22:52:20 -0800 Message-ID: <20151122225220.1fd15ba8@xeon-e3> 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> <564D930C.7060108@intel.com> <20151122200743.34511547@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" To: "Xie, Huawei" Return-path: Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by dpdk.org (Postfix) with ESMTP id B6D748E80 for ; Mon, 23 Nov 2015 07:52:11 +0100 (CET) Received: by pabfh17 with SMTP id fh17so187498617pab.0 for ; Sun, 22 Nov 2015 22:52:11 -0800 (PST) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 23 Nov 2015 05:05:21 +0000 "Xie, Huawei" wrote: > On 11/23/2015 12:07 PM, Stephen Hemminger wrote: > > On Mon, 23 Nov 2015 03:46:31 +0000 > > "Xie, Huawei" wrote: > > > >>> Why cannot we rely on the kernel zeroing the memory ? > >>> If that behavior were to change, then we can zero out the memory > >>> ourselves. > >> It is undocumented kernel behavior. My opinion is if not a big burden, > >> zero out the needed memory ourselves, otherwise resort to this kernel > >> behavior. > > Really, I think it is more an oversight of missing documentation, > > the kernel has always (and will continue) to zero out memory that is given > > to a process. If it didn't it would be a massive security hole. > Agree. I believe this behavior will not change in future. For the > security issue, kernel could also set all bits like to 1. Just wonder if > this is best practice and whether there are other user space programs > rely on this behavior. > Glibc almost certainly depends on this, because heap is grown by mmaping addtional memory.