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>
This commit is contained in:
parent
9be4d45759
commit
2f70e0acd4
1 changed files with 2 additions and 10 deletions
|
@ -195,7 +195,7 @@ static unsigned long current_target(void)
|
||||||
|
|
||||||
static int increase_reservation(unsigned long nr_pages)
|
static int increase_reservation(unsigned long nr_pages)
|
||||||
{
|
{
|
||||||
unsigned long pfn, i, flags;
|
unsigned long pfn, i;
|
||||||
struct page *page;
|
struct page *page;
|
||||||
long rc;
|
long rc;
|
||||||
struct xen_memory_reservation reservation = {
|
struct xen_memory_reservation reservation = {
|
||||||
|
@ -207,8 +207,6 @@ static int increase_reservation(unsigned long nr_pages)
|
||||||
if (nr_pages > ARRAY_SIZE(frame_list))
|
if (nr_pages > ARRAY_SIZE(frame_list))
|
||||||
nr_pages = ARRAY_SIZE(frame_list);
|
nr_pages = ARRAY_SIZE(frame_list);
|
||||||
|
|
||||||
spin_lock_irqsave(&xen_reservation_lock, flags);
|
|
||||||
|
|
||||||
page = balloon_first_page();
|
page = balloon_first_page();
|
||||||
for (i = 0; i < nr_pages; i++) {
|
for (i = 0; i < nr_pages; i++) {
|
||||||
BUG_ON(page == NULL);
|
BUG_ON(page == NULL);
|
||||||
|
@ -251,14 +249,12 @@ static int increase_reservation(unsigned long nr_pages)
|
||||||
balloon_stats.current_pages += rc;
|
balloon_stats.current_pages += rc;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
spin_unlock_irqrestore(&xen_reservation_lock, flags);
|
|
||||||
|
|
||||||
return rc < 0 ? rc : rc != nr_pages;
|
return rc < 0 ? rc : rc != nr_pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int decrease_reservation(unsigned long nr_pages)
|
static int decrease_reservation(unsigned long nr_pages)
|
||||||
{
|
{
|
||||||
unsigned long pfn, i, flags;
|
unsigned long pfn, i;
|
||||||
struct page *page;
|
struct page *page;
|
||||||
int need_sleep = 0;
|
int need_sleep = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -296,8 +292,6 @@ static int decrease_reservation(unsigned long nr_pages)
|
||||||
kmap_flush_unused();
|
kmap_flush_unused();
|
||||||
flush_tlb_all();
|
flush_tlb_all();
|
||||||
|
|
||||||
spin_lock_irqsave(&xen_reservation_lock, flags);
|
|
||||||
|
|
||||||
/* No more mappings: invalidate P2M and add to balloon. */
|
/* No more mappings: invalidate P2M and add to balloon. */
|
||||||
for (i = 0; i < nr_pages; i++) {
|
for (i = 0; i < nr_pages; i++) {
|
||||||
pfn = mfn_to_pfn(frame_list[i]);
|
pfn = mfn_to_pfn(frame_list[i]);
|
||||||
|
@ -312,8 +306,6 @@ static int decrease_reservation(unsigned long nr_pages)
|
||||||
|
|
||||||
balloon_stats.current_pages -= nr_pages;
|
balloon_stats.current_pages -= nr_pages;
|
||||||
|
|
||||||
spin_unlock_irqrestore(&xen_reservation_lock, flags);
|
|
||||||
|
|
||||||
return need_sleep;
|
return need_sleep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue