lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <874fd614-23da-c9b6-95f5-41b544b8df18@redhat.com>
Date:   Mon, 2 Jan 2023 12:55:13 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Soichiro Ueda <the.latticeheart@...il.com>, mst@...hat.com,
        jasowang@...hat.com, akpm@...ux-foundation.org
Cc:     virtualization@...ts.linux-foundation.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        kalutes@...gle.com, mhiramat@...nel.org, cwd@...gle.com
Subject: Re: [PATCH] virtio_balloon: high order allocation

On 29.12.22 06:31, Soichiro Ueda wrote:
> Hi David.
> 
>> How does this affect page migration / balloon compaction etc?
> 
> I guess this patch doesn't affect balloon compaction. When allocating
> pages using alloc_pages(), it skips compaction by masking out
> __GFP_RECLAIM if the order is larger than 0.
> 
> As for page migration, in the current implementation it migrate a
> 0-order page to another 0-order page. With this patch, it may migrate a
> high-order page to another same-order page.
> 
> But I noticed that the migrated high-order page is handled as 0-order
> page in virtballoon_migratepage().
> 
>   >     balloon_page_insert(vb_dev_info, newpage);
> 

Yes, I think suspected that it's broken.

We also might want to handle OOM accordingly by splitting the page and 
retrying migration. Almost nothing should stop a balloon page from 
getting migrated.

One thing to try is allocating a higher-order page and immediately 
splitting it into base pages, and enqueuing base pages only. Only 
inflation would be faster, because you could only deflate base pages.

> We should put the newpage into a page list of the corresponding order,
> like this.
> 
>       balloon_page_enqueue(vb_dev_info, newpage, order);
> 
> I'll fix it in the v2 patch.


Note that I have some more concerns:
* We might end up stealing all higher-order pages from the guest instead
   of eating all of the "small" leftover pieces first. This might be
   undesirable. We discussed this in the past in the context of hugepage
   ballooning [not able to locate the abandoned patches quickly].
* PG_offline won't work as expected anymore and result in kdump reading
   inflated memory, which is undesirable. One workaround would be setting
   PG_offline on all base pages, but this needs some more thought.
* How are we handling a scenario where we are requested to deflate e.g.,
   a single 4096 KiB page but we only have higher-order pages allocated?
   I suspect you would over-deflate right now, which is undesirable.

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ