From: Tim Deegan Subject: Re: [PATCH 04 of 12] x86/mm: Enforce lock ordering for sharing page locks Date: Thu, 19 Jan 2012 12:18:16 +0000 Message-ID: <20120119121816.GF66164@ocelot.phlegethon.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: 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 21:56 -0500 on 15 Jan (1326664584), Andres Lagar-Cavilla wrote: > xen/arch/x86/mm/mem_sharing.c | 91 ++++++++++++++++++++++++++---------------- > xen/arch/x86/mm/mm-locks.h | 18 ++++++++- > xen/include/asm-x86/mm.h | 3 +- > 3 files changed, 76 insertions(+), 36 deletions(-) > > > Use the ordering constructs in mm-locks.h to enforce an order > for the p2m and page locks in the sharing code. Applies to either > the global sharing lock (in audit mode) or the per page locks. Good idea, though there'a rather a lot of passing stack pointers around now. Given that you should only ever be taking one of these paths at a time, and you should never be waitq'd with a lock hels, maybe you could just have a static per-pcpu pg_lock_data struct? Cheers, Tim.