linux-sg2042/drivers/xen
Stefano Stabellini f62805f1f3 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>
2012-05-07 15:33:19 -04:00
..
xen-pciback Two fixes for regressions: 2012-04-06 17:54:53 -07:00
xenbus Features: 2012-03-22 20:16:14 -07:00
xenfs xen: Add xenbus device driver 2011-12-16 13:29:39 -05:00
Kconfig xen/acpi: Fix Kconfig dependency on CPU_FREQ 2012-03-24 09:23:06 -04:00
Makefile xen/acpi/sleep: Enable ACPI sleep via the __acpi_os_prepare_sleep 2012-05-07 15:33:18 -04:00
acpi.c xen/acpi/sleep: Enable ACPI sleep via the __acpi_os_prepare_sleep 2012-05-07 15:33:18 -04:00
balloon.c xen/balloon: Avoid OOM when requesting highmem 2011-11-16 12:13:43 -05:00
biomerge.c xen: using EXPORT_SYMBOL requires including export.h 2012-01-18 15:37:49 -08:00
cpu_hotplug.c xen/bootup: During bootup suppress XENBUS: Unable to read cpu state 2012-02-03 16:05:30 -05:00
events.c xen: support pirq_eoi_map 2012-03-20 15:34:07 -04:00
evtchn.c xen/event: Add reference counting to event channels 2011-11-21 17:14:48 -05:00
features.c xen: clean up asm/xen/hypervisor.h 2008-12-16 21:50:31 +01:00
gntalloc.c xen-gntalloc: introduce missing kfree 2012-01-03 13:39:04 -05:00
gntdev.c xen/grant-table: Support mappings required by blkback 2011-12-20 17:07:27 -05:00
grant-table.c xen: enter/exit lazy_mmu_mode around m2p_override calls 2012-05-07 15:33:19 -04:00
manage.c PM / Sleep: Introduce "late suspend" and "early resume" of devices 2012-01-29 20:38:29 +01:00
pci.c Merge branch 'stable/cleanups-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2011-11-06 20:13:34 -08:00
platform-pci.c xen: initialize platform-pci even if xen_emul_unplug=never 2012-03-22 11:37:11 -04:00
privcmd.c xen/privcmd: Remove unused support for arch specific privcmp mmap 2011-12-16 13:29:42 -05:00
privcmd.h xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
swiotlb-xen.c X86 & IA64: adapt for dma_map_ops changes 2012-03-28 16:36:31 +02:00
sys-hypervisor.c xen: constify all instances of "struct attribute_group" 2012-03-14 12:34:19 -04:00
tmem.c One tiny feature that accidentally got lost in the initial git pull: 2012-03-24 12:20:25 -07:00
xen-acpi-processor.c xen/acpi: Remove the WARN's as they just create noise. 2012-03-21 12:17:22 -04:00
xen-balloon.c Features: 2012-03-22 20:16:14 -07:00
xen-selfballoon.c xen: constify all instances of "struct attribute_group" 2012-03-14 12:34:19 -04:00
xencomm.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00