From: Avi Kivity on
On 04/06/2010 09:25 PM, Jeremy Fitzhardinge wrote:
> On 04/06/2010 09:32 AM, Avi Kivity wrote:
>> Yeah. If we wanted commonality, we could make a balloon_core.c that
>> contains the common code. IMO that's premature, but perhaps there's
>> some meat there (like suspend/resume support and /proc//sys interface).
>
> I think it would be useful to have common:
>
> 1. User and kernel mode ABIs for controlling ballooning. It assumes
> that the different balloon implementations are sufficiently
> similar in semantics. (Once there's a kernel ABI, adding a
> common user ABI is trivial.)
> 2. Policy driving the ballooning driver, at least from the guest
> side. That is, some good metrics from the vm subsystem about
> memory pressure (both positive and negative), and something to
> turn those metrics into requests to the balloon driver.
>
> 1) is not a huge amount of code, but something consistent would be
> nice. 2) is something we've been missing and is a bit of an open
> question/research project anyway.

3) Code that attempts to reclaim 2MB pages when possible

--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Jeremy Fitzhardinge on
On 04/06/2010 11:36 AM, Avi Kivity wrote:
> On 04/06/2010 09:25 PM, Jeremy Fitzhardinge wrote:
>> On 04/06/2010 09:32 AM, Avi Kivity wrote:
>>> Yeah. If we wanted commonality, we could make a balloon_core.c that
>>> contains the common code. IMO that's premature, but perhaps there's
>>> some meat there (like suspend/resume support and /proc//sys interface).
>>
>> I think it would be useful to have common:
>>
>> 1. User and kernel mode ABIs for controlling ballooning. It assumes
>> that the different balloon implementations are sufficiently
>> similar in semantics. (Once there's a kernel ABI, adding a
>> common user ABI is trivial.)
>> 2. Policy driving the ballooning driver, at least from the guest
>> side. That is, some good metrics from the vm subsystem about
>> memory pressure (both positive and negative), and something to
>> turn those metrics into requests to the balloon driver.
>>
>> 1) is not a huge amount of code, but something consistent would be
>> nice. 2) is something we've been missing and is a bit of an open
>> question/research project anyway.
>
> 3) Code that attempts to reclaim 2MB pages when possible

Yes. Ballooning in 4k units is a bit silly.

J

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Dave Hansen on
On Mon, 2010-04-05 at 16:28 -0700, Jeremy Fitzhardinge wrote:
> I guess a way to use it in the short term is to have a loop of the form:
>
> while (guest_size> target) {
> shrink_all_memory(guest_size - target); /* force pages to be free */
> while (p = alloc_page(GFP_NORETRY)) /* vacuum up pages */
> release_page_to_hypervisor(p);
> /* twiddle thumbs */
> }

We also need to remember to consolidate the Xen and virtio-balloon
drivers. They both have their own GFP flags, for instance, but I think
they actually want the exact same thing. They could probably also share
that snippet, right?

-- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Pavel Machek on
Hi!

>>> 1) is not a huge amount of code, but something consistent would be
>>> nice. 2) is something we've been missing and is a bit of an open
>>> question/research project anyway.
>>
>> 3) Code that attempts to reclaim 2MB pages when possible
>
> Yes. Ballooning in 4k units is a bit silly.

Does it make sense to treat ballooning as a form of memory hotplug?

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Avi Kivity on
On 04/08/2010 08:30 AM, Pavel Machek wrote:
> Hi!
>
>
>>>> 1) is not a huge amount of code, but something consistent would be
>>>> nice. 2) is something we've been missing and is a bit of an open
>>>> question/research project anyway.
>>>>
>>> 3) Code that attempts to reclaim 2MB pages when possible
>>>
>> Yes. Ballooning in 4k units is a bit silly.
>>
> Does it make sense to treat ballooning as a form of memory hotplug?
>

It's a fine granularity form of memory hotplug, yes.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/