2014-10-28 18:54:50

by Matt Mullins

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] mm/balloon_compaction: redesign ballooned pages management

On Sat, Sep 27, 2014 at 11:15:16PM +0400, Konstantin Khlebnikov wrote:
> This patch fixes all of them.

It seems to have rendered virtio_balloon completely ineffective without
CONFIG_COMPACTION and CONFIG_BALLOON_COMPACTION, even for the case that I'm
expanding the memory available to my VM.

Was this intended? Should Kconfig be updated so that VIRTIO_BALLOON depends on
BALLOON_COMPACTION now?


2014-10-28 19:56:17

by Konstantin Khlebnikov

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] mm/balloon_compaction: redesign ballooned pages management

On Tue, Oct 28, 2014 at 9:47 PM, Matt Mullins <[email protected]> wrote:
> On Sat, Sep 27, 2014 at 11:15:16PM +0400, Konstantin Khlebnikov wrote:
>> This patch fixes all of them.
>
> It seems to have rendered virtio_balloon completely ineffective without
> CONFIG_COMPACTION and CONFIG_BALLOON_COMPACTION, even for the case that I'm
> expanding the memory available to my VM.

What do you mean by ineffective?

That it cannot handle fragmentation? I saw that without compaction
ballooning works even better:
it allocates pages without GFP_MOVABLE and buddy allocator returns
much less scattered pages.

>
> Was this intended? Should Kconfig be updated so that VIRTIO_BALLOON depends on
> BALLOON_COMPACTION now?

Nope, this is independent feature.

2014-10-28 20:23:36

by Matt Mullins

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] mm/balloon_compaction: redesign ballooned pages management

On Tue, Oct 28, 2014 at 11:56:15PM +0400, Konstantin Khlebnikov wrote:
> On Tue, Oct 28, 2014 at 9:47 PM, Matt Mullins <[email protected]> wrote:
> > On Sat, Sep 27, 2014 at 11:15:16PM +0400, Konstantin Khlebnikov wrote:
> >> This patch fixes all of them.
> >
> > It seems to have rendered virtio_balloon completely ineffective without
> > CONFIG_COMPACTION and CONFIG_BALLOON_COMPACTION, even for the case that I'm
> > expanding the memory available to my VM.
>
> What do you mean by ineffective?

Ballooning does not change the amount of memory available at all. Bisecting
the change got me back to this patch.

I'm currently using 3.18-rc2 and running in qemu-kvm-1.6.2-9.fc20.x86_64 via
libvirt-daemon-1.1.3.6-1.fc20.x86_64.

I'll attach my .config; enabling COMPACTION and BALLOON_COMPACTION makes
virtio-ballooning work again.

> That it cannot handle fragmentation? I saw that without compaction
> ballooning works even better:
> it allocates pages without GFP_MOVABLE and buddy allocator returns
> much less scattered pages.
>
> >
> > Was this intended? Should Kconfig be updated so that VIRTIO_BALLOON depends on
> > BALLOON_COMPACTION now?
>
> Nope, this is independent feature.

Good to know, thanks.


Attachments:
(No filename) (1.19 kB)
config-3.18-rc2 (47.82 kB)
Download all attachments

2014-10-29 11:52:04

by Konstantin Khlebnikov

[permalink] [raw]
Subject: [PATCH] mm/balloon_compaction: fix deflation when compaction is disabled

Fix for commit d6d86c0a7f8ddc5b38cf089222cb1d9540762dc2
("mm/balloon_compaction: redesign ballooned pages management").

If CONFIG_BALLOON_COMPACTION=n balloon_page_insert() does not link
pages with balloon and doesn't set PagePrivate flag, as a result
balloon_page_dequeue cannot get any pages because it thinks that
all of them are isolated. Without balloon compaction nobody can
isolate ballooned pages, it's safe to remove this check.

Signed-off-by: Konstantin Khlebnikov <[email protected]>
Reported-by: Matt Mullins <[email protected]>
Cc: Stable <[email protected]> (v3.17)
---
mm/balloon_compaction.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c
index b3cbe19..fcad832 100644
--- a/mm/balloon_compaction.c
+++ b/mm/balloon_compaction.c
@@ -68,11 +68,13 @@ struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info)
* to be released by the balloon driver.
*/
if (trylock_page(page)) {
+#ifdef CONFIG_BALLOON_COMPACTION
if (!PagePrivate(page)) {
/* raced with isolation */
unlock_page(page);
continue;
}
+#endif
spin_lock_irqsave(&b_dev_info->pages_lock, flags);
balloon_page_delete(page);
__count_vm_event(BALLOON_DEFLATE);

2014-10-30 01:06:21

by Matt Mullins

[permalink] [raw]
Subject: Re: [PATCH] mm/balloon_compaction: fix deflation when compaction is disabled

On Wed, Oct 29, 2014 at 02:51:07PM +0400, Konstantin Khlebnikov wrote:
> Fix for commit d6d86c0a7f8ddc5b38cf089222cb1d9540762dc2
> ("mm/balloon_compaction: redesign ballooned pages management").
>
> If CONFIG_BALLOON_COMPACTION=n balloon_page_insert() does not link
> pages with balloon and doesn't set PagePrivate flag, as a result
> balloon_page_dequeue cannot get any pages because it thinks that
> all of them are isolated. Without balloon compaction nobody can
> isolate ballooned pages, it's safe to remove this check.
>
> Signed-off-by: Konstantin Khlebnikov <[email protected]>
> Reported-by: Matt Mullins <[email protected]>
> Cc: Stable <[email protected]> (v3.17)

That seems to do it, thanks!

Tested-by: Matt Mullins <[email protected]>