summaryrefslogtreecommitdiffstats
path: root/drivers/xen/tmem.c
diff options
context:
space:
mode:
authorStefano Stabellini <Stefano.Stabellini@eu.citrix.com>2012-04-24 11:55:43 +0100
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-05-07 15:33:19 -0400
commitf62805f1f30a40e354bd036b4cb799863a39be4b (patch)
tree8b2005ae7c4ba79c7b711a33da3b571d1f8c225e /drivers/xen/tmem.c
parent211063dc159695bd6072c5393e9bc729481c6ede (diff)
downloadlinux-f62805f1f30a40e354bd036b4cb799863a39be4b.tar.bz2
xen: enter/exit lazy_mmu_mode around m2p_override calls
This patch is a significant performance improvement for the m2p_override: about 6% using the gntdev device. Each m2p_add/remove_override call issues a MULTI_grant_table_op and a __flush_tlb_single if kmap_op != NULL. Batching all the calls together is a great performance benefit because it means issuing one hypercall total rather than two hypercall per page. If paravirt_lazy_mode is set PARAVIRT_LAZY_MMU, all these calls are going to be batched together, otherwise they are issued one at a time. Adding arch_enter_lazy_mmu_mode/arch_leave_lazy_mmu_mode around the m2p_add/remove_override calls forces paravirt_lazy_mode to PARAVIRT_LAZY_MMU, therefore makes sure that they are always batched. However it is not safe to call arch_enter_lazy_mmu_mode if we are in interrupt context or if we are already in PARAVIRT_LAZY_MMU mode, so check for both conditions before doing so. Changes in v4: - rebased on 3.4-rc4: all the m2p_override users call gnttab_unmap_refs and gnttab_map_refs; - check whether we are in interrupt context and the lazy_mode we are in before calling arch_enter/leave_lazy_mmu_mode. Changes in v3: - do not call arch_enter/leave_lazy_mmu_mode in xen_blkbk_unmap, that can be called in interrupt context. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> [v5: s/int lazy/bool lazy/] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/tmem.c')
0 files changed, 0 insertions, 0 deletions