From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH 03 of 12] x86/mm: Add per-page locking for memory sharing, when audits are disabled Date: Thu, 19 Jan 2012 13:13:14 +0000 Message-ID: <20120119131314.GL66164@ocelot.phlegethon.org> References: <11916fe20dd274ff370b.1326682583@xdev.gridcentric.ca> <20120119130230.GI66164@ocelot.phlegethon.org> <300ebad65ef953dac0d27446195232d3.squirrel@webmail.lagarcavilla.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <300ebad65ef953dac0d27446195232d3.squirrel@webmail.lagarcavilla.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Andres Lagar-Cavilla Cc: xen-devel@lists.xensource.com, ian.campbell@citrix.com, andres@gridcentric.ca, keir.xen@gmail.com, jbeulich@suse.com, ian.jackson@citrix.com, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org At 05:06 -0800 on 19 Jan (1326949574), Andres Lagar-Cavilla wrote: > > At 21:56 -0500 on 15 Jan (1326664583), Andres Lagar-Cavilla wrote: > >> @@ -510,26 +684,63 @@ int mem_sharing_share_pages(struct domai > >> smfn = get_gfn(sd, sgfn, &smfn_type); > >> cmfn = get_gfn(cd, cgfn, &cmfn_type); > >> > >> - ret = XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID; > >> - spage = mem_sharing_lookup(mfn_x(smfn)); > >> - if ( spage == NULL ) > >> + /* This tricky business is to avoid two callers deadlocking if > >> + * grabbing pages in opposite client/source order */ > > > > I think you need to delete the XXX comment just above. :) > > > Well, that XXX comment applies if get_gfn locks the p2m, and then what > we're grabbing in mem_sharing_lookup are lock per mfn, essentially. To Oh, I see - wrong deadlock!. :) Tim.