diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-09-03 02:11:17 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2010-11-20 01:17:25 -0500 |
commit | 2f70e0acd496398671606767122846278126a88b (patch) | |
tree | 1f274e6525f4f87699a6514235e6b8867638237a /drivers/xen | |
parent | 9be4d4575906af9698de660e477f949a076c87e1 (diff) |
xen/balloon: the balloon_lock is useless
The balloon_lock is useless, since it protects nothing against nothing.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/balloon.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index df26ee9caa68..77b5dc3597e3 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -195,7 +195,7 @@ static unsigned long current_target(void) | |||
195 | 195 | ||
196 | static int increase_reservation(unsigned long nr_pages) | 196 | static int increase_reservation(unsigned long nr_pages) |
197 | { | 197 | { |
198 | unsigned long pfn, i, flags; | 198 | unsigned long pfn, i; |
199 | struct page *page; | 199 | struct page *page; |
200 | long rc; | 200 | long rc; |
201 | struct xen_memory_reservation reservation = { | 201 | struct xen_memory_reservation reservation = { |
@@ -207,8 +207,6 @@ static int increase_reservation(unsigned long nr_pages) | |||
207 | if (nr_pages > ARRAY_SIZE(frame_list)) | 207 | if (nr_pages > ARRAY_SIZE(frame_list)) |
208 | nr_pages = ARRAY_SIZE(frame_list); | 208 | nr_pages = ARRAY_SIZE(frame_list); |
209 | 209 | ||
210 | spin_lock_irqsave(&xen_reservation_lock, flags); | ||
211 | |||
212 | page = balloon_first_page(); | 210 | page = balloon_first_page(); |
213 | for (i = 0; i < nr_pages; i++) { | 211 | for (i = 0; i < nr_pages; i++) { |
214 | BUG_ON(page == NULL); | 212 | BUG_ON(page == NULL); |
@@ -251,14 +249,12 @@ static int increase_reservation(unsigned long nr_pages) | |||
251 | balloon_stats.current_pages += rc; | 249 | balloon_stats.current_pages += rc; |
252 | 250 | ||
253 | out: | 251 | out: |
254 | spin_unlock_irqrestore(&xen_reservation_lock, flags); | ||
255 | |||
256 | return rc < 0 ? rc : rc != nr_pages; | 252 | return rc < 0 ? rc : rc != nr_pages; |
257 | } | 253 | } |
258 | 254 | ||
259 | static int decrease_reservation(unsigned long nr_pages) | 255 | static int decrease_reservation(unsigned long nr_pages) |
260 | { | 256 | { |
261 | unsigned long pfn, i, flags; | 257 | unsigned long pfn, i; |
262 | struct page *page; | 258 | struct page *page; |
263 | int need_sleep = 0; | 259 | int need_sleep = 0; |
264 | int ret; | 260 | int ret; |
@@ -296,8 +292,6 @@ static int decrease_reservation(unsigned long nr_pages) | |||
296 | kmap_flush_unused(); | 292 | kmap_flush_unused(); |
297 | flush_tlb_all(); | 293 | flush_tlb_all(); |
298 | 294 | ||
299 | spin_lock_irqsave(&xen_reservation_lock, flags); | ||
300 | |||
301 | /* No more mappings: invalidate P2M and add to balloon. */ | 295 | /* No more mappings: invalidate P2M and add to balloon. */ |
302 | for (i = 0; i < nr_pages; i++) { | 296 | for (i = 0; i < nr_pages; i++) { |
303 | pfn = mfn_to_pfn(frame_list[i]); | 297 | pfn = mfn_to_pfn(frame_list[i]); |
@@ -312,8 +306,6 @@ static int decrease_reservation(unsigned long nr_pages) | |||
312 | 306 | ||
313 | balloon_stats.current_pages -= nr_pages; | 307 | balloon_stats.current_pages -= nr_pages; |
314 | 308 | ||
315 | spin_unlock_irqrestore(&xen_reservation_lock, flags); | ||
316 | |||
317 | return need_sleep; | 309 | return need_sleep; |
318 | } | 310 | } |
319 | 311 | ||