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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 08 Nov 2017 17:16:19 +0100
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     Michal Hocko <mhocko@...nel.org>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        Mel Gorman <mgorman@...hsingularity.net>,
        YASUAKI ISHIMATSU <yasu.isimatu@...il.com>,
        Hillf Danton <hillf.zj@...baba-inc.com>,
        Johannes Weiner <hannes@...xchg.org>,
        "K. Y. Srinivasan" <kys@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        Alex Ng <alexng@...rosoft.com>
Subject: Re: [PATCH RFC] mm/memory_hotplug: make it possible to offline blocks with reserved pages

Michal Hocko <mhocko@...nel.org> writes:

> On Wed 08-11-17 16:39:49, Vitaly Kuznetsov wrote:
>> Michal Hocko <mhocko@...nel.org> writes:
>> 
>> > On Wed 08-11-17 14:01:55, Vitaly Kuznetsov wrote:
>> >> Hyper-V balloon driver needs to hotplug memory in smaller chunks and to
>> >> workaround Linux's 128Mb allignment requirement so it does a trick: partly
>> >> populated 128Mb blocks are added and then a custom online_page_callback
>> >> hook checks if the particular page is 'backed' during onlining, in case it
>> >> is not backed it is left in Reserved state. When the host adds more pages
>> >> to the block we bring them online from the driver (see
>> >> hv_bring_pgs_online()/hv_page_online_one() in drivers/hv/hv_balloon.c).
>> >> Eventually the whole block becomes fully populated and we hotplug the next
>> >> 128Mb. This all works for quite some time already.
>> >
>> > Why does HyperV needs to workaround the section size limit in the first
>> > place? We are allocation memmap for the whole section anyway so it won't
>> > save any memory. So the whole thing sounds rather dubious to me.
>> >
>> 
>> Memory hotplug requirements in Windows are different, they have 2Mb
>> granularity, not 128Mb like we have in Linux x86.
>> 
>> Imagine there's a request to add 32Mb of memory comming from the
>> Hyper-V host. What can we do? Don't add anything at all and wait till
>> we're suggested to add > 128Mb and then add a section or the current
>> approach.
>
> Use a different approach than memory hotplug. E.g. memory balloning.
>

But how? When we boot we may have very little memory and later on we
hotplug a lot so we may not even be able to ballon all possible memory
without running out of memory.

>> >> What is not working is offlining of such partly populated blocks:
>> >> check_pages_isolated_cb() callback will not pass with a sinle Reserved page
>> >> and we end up with -EBUSY. However, there's no reason to fail offlining in
>> >> this case: these pages are already offline, we may just skip them. Add the
>> >> appropriate workaround to test_pages_isolated().
>> >
>> > How do you recognize pages reserved by other users. You cannot simply
>> > remove them, it would just blow up.
>> >
>> 
>> I exepcted sumothing like that, thus RFC. Is there a way to detect pages
>> which were never onlined? E.g. it is Reserved and count == 0?
>
> That would be quite tricky. But I am not convinced that the whole thing
> makes any sense at all. We are in fact always creating the full section
> so onlining only a part of it sounds really dubious to me.

I understand the concearn but this is something which works nowdays (and
for a long time already) so unless we're able to suggest some better API
for it (e.g. variable section size for example) we'll probably have to
live with it.

The issue I'm trying to address with the patch is not of top priority:
there's no such thing as memory unplug in Hyper-V so offlining sections
is not something users do every day.

-- 
  Vitaly

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ