[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20110328093318.GG13826@router-fw-old.local.net-space.pl>
Date: Mon, 28 Mar 2011 11:33:18 +0200
From: Daniel Kiper <dkiper@...-space.pl>
To: ian.campbell@...rix.com, akpm@...ux-foundation.org,
andi.kleen@...el.com, haicheng.li@...ux.intel.com,
fengguang.wu@...el.com, jeremy@...p.org, konrad.wilk@...cle.com,
dan.magenheimer@...cle.com, v.tolstov@...fip.ru, pasik@....fi,
dave@...ux.vnet.ibm.com, wdauchy@...il.com, rientjes@...gle.com,
xen-devel@...ts.xensource.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: [PATCH 2/4] xen/balloon: Simplify HVM integration
Simplify HVM integration proposed by Stefano Stabellini
in 53d5522cad291a0e93a385e0594b6aea6b54a071.
Signed-off-by: Daniel Kiper <dkiper@...-space.pl>
---
drivers/xen/balloon.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 61665b2..42a0ba0 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -246,7 +246,7 @@ static enum bp_state increase_reservation(unsigned long nr_pages)
set_phys_to_machine(pfn, frame_list[i]);
/* Link back into the page tables if not highmem. */
- if (!xen_hvm_domain() && !PageHighMem(page)) {
+ if (xen_pv_domain() && !PageHighMem(page)) {
int ret;
ret = HYPERVISOR_update_va_mapping(
(unsigned long)__va(pfn << PAGE_SHIFT),
@@ -293,7 +293,7 @@ static enum bp_state decrease_reservation(unsigned long nr_pages, gfp_t gfp)
scrub_page(page);
- if (!xen_hvm_domain() && !PageHighMem(page)) {
+ if (xen_pv_domain() && !PageHighMem(page)) {
ret = HYPERVISOR_update_va_mapping(
(unsigned long)__va(pfn << PAGE_SHIFT),
__pte_ma(0), 0);
@@ -429,7 +429,7 @@ EXPORT_SYMBOL(free_xenballooned_pages);
static int __init balloon_init(void)
{
- unsigned long pfn, nr_pages, extra_pfn_end;
+ unsigned long pfn, extra_pfn_end;
struct page *page;
if (!xen_domain())
@@ -437,11 +437,7 @@ static int __init balloon_init(void)
pr_info("xen/balloon: Initialising balloon driver.\n");
- if (xen_pv_domain())
- nr_pages = xen_start_info->nr_pages;
- else
- nr_pages = max_pfn;
- balloon_stats.current_pages = min(nr_pages, max_pfn);
+ balloon_stats.current_pages = xen_pv_domain() ? min(xen_start_info->nr_pages, max_pfn) : max_pfn;
balloon_stats.target_pages = balloon_stats.current_pages;
balloon_stats.balloon_low = 0;
balloon_stats.balloon_high = 0;
--
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists