From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andres Lagar-Cavilla Subject: [PATCH 0 of 3] x86/mm: Relieve contention of p2m lock on three hot paths Date: Tue, 24 Apr 2012 15:34:10 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: "Zhang, Yang Z" , keir@xen.org, andres@gridcentric.ca, tim@xen.org List-Id: xen-devel@lists.xenproject.org This series is motivated by recent scalability issues reported by Yhan Z Zang from Intel. The general pattern used is to perform a synchronized p2m query to take care of paging in, PoD allocation or unsharing, and then take a reference to the underlying page. The reference ensures the page can be safely mapped by the caller as it won't be paged out. The p2m lock can then be relased and not held while actual work is performed on the page. This reduces p2m locked critical sections to a minimum. The pattern is applied to page table walking and emulation of rep movs. By checking for the bogus zero ram_gpa value on the general emulation function, we also reduce contention derived from the p2m lock for that hot path. Signed-off-by: Andres Lagar-Cavilla xen/arch/x86/mm/hap/guest_walk.c | 6 ++++- xen/arch/x86/hvm/emulate.c | 27 +++++++--------------- xen/arch/x86/hvm/emulate.c | 48 +++++++++++++++++++++------------------ 3 files changed, 40 insertions(+), 41 deletions(-)