public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Mel Gorman <mgorman@techsingularity.net>,
	YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>,
	Hillf Danton <hillf.zj@alibaba-inc.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Alex Ng <alexng@microsoft.com>
Subject: Re: [PATCH RFC] mm/memory_hotplug: make it possible to offline blocks with reserved pages
Date: Thu, 09 Nov 2017 14:30:18 +0100	[thread overview]
Message-ID: <8760ajlgut.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20171109131612.wjjwwvnxo2yxgswx@dhcp22.suse.cz> (Michal Hocko's message of "Thu, 9 Nov 2017 14:16:12 +0100")

Michal Hocko <mhocko@kernel.org> writes:

> On Wed 08-11-17 17:16:19, Vitaly Kuznetsov wrote:
>> Michal Hocko <mhocko@kernel.org> writes:
>> 
>> > On Wed 08-11-17 16:39:49, Vitaly Kuznetsov wrote:
>> >> Michal Hocko <mhocko@kernel.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.
>
> Just add more memory and make part of it unusable and return it back to
> the host via standard ballooning means.

We don't have control over how much memory host gives us and we have no
way to return anything to the host.

>
> How realistic is that the host gives only such a small amount of memory
> btw?

It happens all the time, Hyper-V host will gradually increase guest's
memory when Dynamic Memory is enabled. Moreover, there's a manual
interface when host's admin can hotplug memory to guests (starting
WS2016) with 2M granularity.

-- 
  Vitaly

  reply	other threads:[~2017-11-09 13:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-08 13:01 [PATCH RFC] mm/memory_hotplug: make it possible to offline blocks with reserved pages Vitaly Kuznetsov
2017-11-08 14:25 ` Michal Hocko
2017-11-08 15:39   ` Vitaly Kuznetsov
2017-11-08 15:57     ` Michal Hocko
2017-11-08 16:16       ` Vitaly Kuznetsov
2017-11-09 13:16         ` Michal Hocko
2017-11-09 13:30           ` Vitaly Kuznetsov [this message]
2017-11-09 13:42             ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760ajlgut.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexng@microsoft.com \
    --cc=hannes@cmpxchg.org \
    --cc=hillf.zj@alibaba-inc.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=vbabka@suse.cz \
    --cc=yasu.isimatu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox