diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-12 12:09:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-12 12:09:41 -0400 |
commit | 26f0cf91813bdc8e61595f8ad6660251e2ee9cf6 (patch) | |
tree | db129d45fba03e3e59392410d0f35ba7d3e438e6 /drivers/xen/balloon.c | |
parent | d862b13bc8cbab9692fbe0ef44c40d0488b81af1 (diff) | |
parent | fe96eb404e33b59bb39f7050205f7c56c1c7d686 (diff) |
Merge branch 'stable/xen-swiotlb-0.8.6' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
* 'stable/xen-swiotlb-0.8.6' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
x86: Detect whether we should use Xen SWIOTLB.
pci-swiotlb-xen: Add glue code to setup dma_ops utilizing xen_swiotlb_* functions.
swiotlb-xen: SWIOTLB library for Xen PV guest with PCI passthrough.
xen/mmu: inhibit vmap aliases rather than trying to clear them out
vmap: add flag to allow lazy unmap to be disabled at runtime
xen: Add xen_create_contiguous_region
xen: Rename the balloon lock
xen: Allow unprivileged Xen domains to create iomap pages
xen: use _PAGE_IOMAP in ioremap to do machine mappings
Fix up trivial conflicts (adding both xen swiotlb and xen pci platform
driver setup close to each other) in drivers/xen/{Kconfig,Makefile} and
include/xen/xen-ops.h
Diffstat (limited to 'drivers/xen/balloon.c')
-rw-r--r-- | drivers/xen/balloon.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 1a0d8c2a0354..500290b150bb 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -85,13 +85,6 @@ static struct sys_device balloon_sysdev; | |||
85 | 85 | ||
86 | static int register_balloon(struct sys_device *sysdev); | 86 | static int register_balloon(struct sys_device *sysdev); |
87 | 87 | ||
88 | /* | ||
89 | * Protects atomic reservation decrease/increase against concurrent increases. | ||
90 | * Also protects non-atomic updates of current_pages and driver_pages, and | ||
91 | * balloon lists. | ||
92 | */ | ||
93 | static DEFINE_SPINLOCK(balloon_lock); | ||
94 | |||
95 | static struct balloon_stats balloon_stats; | 88 | static struct balloon_stats balloon_stats; |
96 | 89 | ||
97 | /* We increase/decrease in batches which fit in a page */ | 90 | /* We increase/decrease in batches which fit in a page */ |
@@ -210,7 +203,7 @@ static int increase_reservation(unsigned long nr_pages) | |||
210 | if (nr_pages > ARRAY_SIZE(frame_list)) | 203 | if (nr_pages > ARRAY_SIZE(frame_list)) |
211 | nr_pages = ARRAY_SIZE(frame_list); | 204 | nr_pages = ARRAY_SIZE(frame_list); |
212 | 205 | ||
213 | spin_lock_irqsave(&balloon_lock, flags); | 206 | spin_lock_irqsave(&xen_reservation_lock, flags); |
214 | 207 | ||
215 | page = balloon_first_page(); | 208 | page = balloon_first_page(); |
216 | for (i = 0; i < nr_pages; i++) { | 209 | for (i = 0; i < nr_pages; i++) { |
@@ -254,7 +247,7 @@ static int increase_reservation(unsigned long nr_pages) | |||
254 | balloon_stats.current_pages += rc; | 247 | balloon_stats.current_pages += rc; |
255 | 248 | ||
256 | out: | 249 | out: |
257 | spin_unlock_irqrestore(&balloon_lock, flags); | 250 | spin_unlock_irqrestore(&xen_reservation_lock, flags); |
258 | 251 | ||
259 | return rc < 0 ? rc : rc != nr_pages; | 252 | return rc < 0 ? rc : rc != nr_pages; |
260 | } | 253 | } |
@@ -299,7 +292,7 @@ static int decrease_reservation(unsigned long nr_pages) | |||
299 | kmap_flush_unused(); | 292 | kmap_flush_unused(); |
300 | flush_tlb_all(); | 293 | flush_tlb_all(); |
301 | 294 | ||
302 | spin_lock_irqsave(&balloon_lock, flags); | 295 | spin_lock_irqsave(&xen_reservation_lock, flags); |
303 | 296 | ||
304 | /* No more mappings: invalidate P2M and add to balloon. */ | 297 | /* No more mappings: invalidate P2M and add to balloon. */ |
305 | for (i = 0; i < nr_pages; i++) { | 298 | for (i = 0; i < nr_pages; i++) { |
@@ -315,7 +308,7 @@ static int decrease_reservation(unsigned long nr_pages) | |||
315 | 308 | ||
316 | balloon_stats.current_pages -= nr_pages; | 309 | balloon_stats.current_pages -= nr_pages; |
317 | 310 | ||
318 | spin_unlock_irqrestore(&balloon_lock, flags); | 311 | spin_unlock_irqrestore(&xen_reservation_lock, flags); |
319 | 312 | ||
320 | return need_sleep; | 313 | return need_sleep; |
321 | } | 314 | } |