From: "Jan Beulich" Subject: [PATCH] further shrink the big-lock window Date: Thu, 22 Mar 2007 14:21:45 +0000 Message-ID: <46029F09.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org A few more adjustments to when the 'big' lock is taken/dropped. (The WARN_ON used here depends on the previously sent patch adding common support for this construct). Also, fix a case where the foreign domain setting may not get properly cleared at the end of a hypercall (in case of an early error). Signed-off-by: Jan Beulich Index: 2007-03-19/xen/arch/x86/mm.c =================================================================== --- 2007-03-19.orig/xen/arch/x86/mm.c 2007-03-19 13:17:45.000000000 +0100 +++ 2007-03-19/xen/arch/x86/mm.c 2007-03-19 13:21:29.000000000 +0100 @@ -2431,13 +2431,13 @@ int do_mmu_update( guest_handle_add_offset(ureqs, 1); } - domain_mmap_cache_destroy(&mapcache); - domain_mmap_cache_destroy(&sh_mapcache); - process_deferred_ops(); UNLOCK_BIGLOCK(d); + domain_mmap_cache_destroy(&mapcache); + domain_mmap_cache_destroy(&sh_mapcache); + out: /* Add incremental work we have done to the @done output parameter. */ if ( unlikely(!guest_handle_is_null(pdone)) ) @@ -2740,6 +2740,10 @@ int do_update_va_mapping(unsigned long v guest_unmap_l1e(v, pl1e); pl1e = NULL; + process_deferred_ops(); + + UNLOCK_BIGLOCK(d); + switch ( flags & UVMF_FLUSHTYPE_MASK ) { case UVMF_TLB_FLUSH: @@ -2785,9 +2789,7 @@ int do_update_va_mapping(unsigned long v break; } - process_deferred_ops(); - - UNLOCK_BIGLOCK(d); + WARN_ON(this_cpu(percpu_mm_info).deferred_ops); return rc; } @@ -2806,6 +2808,8 @@ int do_update_va_mapping_otherdomain(uns rc = do_update_va_mapping(va, val64, flags); + this_cpu(percpu_mm_info).foreign = NULL; + return rc; }