From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: Re: [PATCH] eal/bsd: don't zero the pages during mmap in contigmem Date: Mon, 8 May 2017 17:13:34 +0800 Message-ID: <20170508091334.GB11935@debian> References: <20170508080916.4317-1-tiwei.bie@intel.com> <20170508085357.GA47408@bricha3-MOBL3.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: dev@dpdk.org, stable@dpdk.org To: Bruce Richardson Return-path: Content-Disposition: inline In-Reply-To: <20170508085357.GA47408@bricha3-MOBL3.ger.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, May 08, 2017 at 09:53:57AM +0100, Bruce Richardson wrote: > On Mon, May 08, 2017 at 08:09:16AM +0000, Tiwei Bie wrote: > > Don't zero the pages during mmap in contigmem. Instead, zero the > > pages after mmap in primary process. Otherwise, the multi-process > > support will be broken, as the pages will be zeroed when secondary > > processes map the memory. > > > > Fixes: 82f931805506 ("contigmem: zero all pages during mmap") > > Cc: stable@dpdk.org > > > > Signed-off-by: Tiwei Bie > > --- > I agree there is a problem here, but I'm not sure about the solution to > it. I still think that the kernel should zero the pages before they get > given to userspace. Is there any way to keep that working e.g > > * have them zeroed on mmap only when they are not already mmaped into > another process? > * have them zeroed on init, and again on unmap by the last process to > have them mapped? > I think it's the simplest way to fix it in userspace, so I just did it. I'd like to fix it in kernel if you also prefer this. Best regards, Tiwei Bie