From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH XEN v6 30/32] tools/libs/call: linux: avoid forking between mmap and madvise Date: Fri, 11 Dec 2015 17:16:21 +0000 Message-ID: <1449854181.30975.80.camel@citrix.com> References: <1449141675.4424.125.camel@citrix.com> <1449141749-14940-1-git-send-email-ian.campbell@citrix.com> <1449141749-14940-31-git-send-email-ian.campbell@citrix.com> <22120.21560.76627.495270@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <22120.21560.76627.495270@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: wei.liu2@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-12-09 at 16:18 +0000, Ian Jackson wrote: > Ian Campbell writes ("[PATCH XEN v6 30/32] tools/libs/call: linux: avoid > forking between mmap and madvise"): > > Use pthread_atfork to prevent the application from forking before the > > madvisoe(), which would result in CoW mappings getting passed to > > hypercalls. > > OMG. > > Is it not possible (not effective) to use mlock/madvise in the parent > ? > > pthread_atfork is a very big hammer to be using in libxc. I think we decided in our RL conversation the other day that this was indeed unnecessary and the docs updates (just sent) together with a bug fix (touch the memory after madvise to un-cow it) would be sufficient for now. Ian.