|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] Re: [PATCH] xen/balloon: Memory hotplug support for Xen ball
To: |
Dave Hansen <dave@xxxxxxxxxxxxxxxxxx> |
Subject: |
[Xen-devel] Re: [PATCH] xen/balloon: Memory hotplug support for Xen balloon driver |
From: |
Daniel Kiper <dkiper@xxxxxxxxxxxx> |
Date: |
Tue, 29 Mar 2011 20:18:52 +0200 |
Cc: |
jeremy@xxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, ian.campbell@xxxxxxxxxx, haicheng.li@xxxxxxxxxxxxxxx, konrad.wilk@xxxxxxxxxx, dan.magenheimer@xxxxxxxxxx, v.tolstov@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx, rientjes@xxxxxxxxxx, andi.kleen@xxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, fengguang.wu@xxxxxxxxx, Daniel Kiper <dkiper@xxxxxxxxxxxx>, wdauchy@xxxxxxxxx |
Delivery-date: |
Tue, 29 Mar 2011 11:20:56 -0700 |
Envelope-to: |
www-data@xxxxxxxxxxxxxxxxxxx |
In-reply-to: |
<1301327727.31700.8354.camel@nimitz> |
List-help: |
<mailto:xen-devel-request@lists.xensource.com?subject=help> |
List-id: |
Xen developer discussion <xen-devel.lists.xensource.com> |
List-post: |
<mailto:xen-devel@lists.xensource.com> |
List-subscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe> |
List-unsubscribe: |
<http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe> |
References: |
<20110328094757.GJ13826@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <1301327727.31700.8354.camel@nimitz> |
Sender: |
xen-devel-bounces@xxxxxxxxxxxxxxxxxxx |
User-agent: |
Mutt/1.3.28i |
On Mon, Mar 28, 2011 at 08:55:27AM -0700, Dave Hansen wrote:
> 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);
Yes, you are right. I am wrong. I will correct that. However, as I said
ealier I do not like ALIGN() in size context. For me ALIGN() is operation
on an address which aligns this address to specified boundary. That is
why I prefer use here open coded version (I agree that it is the same
to ALIGN()). I think that ROUND() macro would be better in size context.
However, I am not native english speaker and if I missed something correct
me, please.
> You might also want to consider some nicer units for those suckers.
What do you mind ??? I think that in that context PAGES_PER_SECTION
is quite good.
> 'start_paddr' is _much_ easier to grok than 'start', for instance.
OK.
Daniel
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|