lkml.org 
[lkml]   [2011]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] xen/balloon: Memory hotplug support for Xen balloon driver
From
Date
On Mon, 2011-03-28 at 11:47 +0200, Daniel Kiper wrote:
>
> +static enum bp_state reserve_additional_memory(long credit)
> +{
> + int nid, rc;
> + u64 start;
> + unsigned long balloon_hotplug = credit;
> +
> + start = PFN_PHYS(SECTION_ALIGN_UP(max_pfn));
> + balloon_hotplug = (balloon_hotplug & PAGE_SECTION_MASK) + PAGES_PER_SECTION;
> + nid = memory_add_physaddr_to_nid(start);

Is the 'balloon_hotplug' calculation correct? I _think_ you're trying
to round up to the SECTION_SIZE_PAGES. But, if 'credit' was already
section-aligned I think you'll unnecessarily round up to the next
SECTION_SIZE_PAGES boundary. Should it just be:

balloon_hotplug = ALIGN(balloon_hotplug, PAGES_PER_SECTION);

You might also want to consider some nicer units for those suckers.
'start_paddr' is _much_ easier to grok than 'start', for instance.

-- Dave



\
 
 \ /
  Last update: 2011-03-28 17:57    [W:0.065 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site