From: Michal Hocko <mhocko@kernel.org>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
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: Wed, 8 Nov 2017 16:57:40 +0100 [thread overview]
Message-ID: <20171108155740.z7fwptk3jg6rc7mv@dhcp22.suse.cz> (raw)
In-Reply-To: <87y3nglqyi.fsf@vitty.brq.redhat.com>
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.
> >> 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.
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-11-08 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-08 13:01 Vitaly Kuznetsov
2017-11-08 14:25 ` Michal Hocko
2017-11-08 15:39 ` Vitaly Kuznetsov
2017-11-08 15:57 ` Michal Hocko [this message]
2017-11-08 16:16 ` Vitaly Kuznetsov
2017-11-09 13:16 ` Michal Hocko
2017-11-09 13:30 ` Vitaly Kuznetsov
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=20171108155740.z7fwptk3jg6rc7mv@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--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=sthemmin@microsoft.com \
--cc=vbabka@suse.cz \
--cc=vkuznets@redhat.com \
--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