From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: linux-mm@kvack.org, Mel Gorman <mgorman@suse.de>,
qiuxishi@huawei.com, toshi.kani@hpe.com, xieyisheng1@huawei.com,
slaoub@gmail.com, iamjoonsoo.kim@lge.com,
Zhang Zhen <zhenzhang.zhang@huawei.com>,
Reza Arbab <arbab@linux.vnet.ibm.com>,
Yasuaki Ishimatsu <yasu.isimatu@gmail.com>,
Tang Chen <tangchen@cn.fujitsu.com>,
Vlastimil Babka <vbabka@suse.cz>,
Andrea Arcangeli <aarcange@redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>,
Daniel Kiper <daniel.kiper@oracle.com>,
Igor Mammedov <imammedo@redhat.com>,
Andi Kleen <ak@linux.intel.com>
Subject: Re: ZONE_NORMAL vs. ZONE_MOVABLE
Date: Wed, 15 Mar 2017 13:53:09 +0100 [thread overview]
Message-ID: <87k27qd7m2.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20170315122914.GG32620@dhcp22.suse.cz> (Michal Hocko's message of "Wed, 15 Mar 2017 13:29:14 +0100")
Michal Hocko <mhocko@kernel.org> writes:
> On Wed 15-03-17 11:48:37, Vitaly Kuznetsov wrote:
>> Michal Hocko <mhocko@kernel.org> writes:
> [...]
>> Speaking about long term approach,
>
> Not really related to the patch but ok (I hope this will not distract
> from the original intention here)...
>
Yes, not directly related to your patch.
>> (I'm not really familiar with the history of memory zones code so please
>> bear with me if my questions are stupid)
>>
>> Currently when we online memory blocks we need to know where to put the
>> boundary between NORMAL and MOVABLE and this is a very hard decision to
>> make, no matter if we do this from kernel or from userspace. In theory,
>> we just want to avoid redundant limitations with future unplug but we
>> don't really know how much memory we'll need for kernel allocations in
>> future.
>
> yes, and that is why I am not really all that happy about the whole
> movable zones concept. It is basically reintroducing highmem issues from
> 32b times. But this is the only concept we currently have to provide a
> reliable memory hotremove right now.
>
>> What actually stops us from having the following approach:
>> 1) Everything is added to MOVABLE
>> 2) When we're out of memory for kernel allocations in NORMAL we 'harvest'
>> the first MOVABLE block and 'convert' it to NORMAL. It may happen that
>> there is no free pages in this block but it was MOVABLE which means we
>> can move all allocations somewhere else.
>> 3) Freeing the whole 128mb memblock takes time but we don't need to wait
>> till it finishes, we just need to satisfy the currently pending
>> allocation and we can continue moving everything else in the background.
>
> Although it sounds like a good idea at first sight there are many tiny
> details which will make it much more complicated. First of all, how
> do we know that the lowmem (resp. all zones normal zones) are under
> pressure to reduce the movable zone? Getting OOM for ~__GFP_MOVABLE
> request? Isn't that too late already?
Yes, I was basically thinking about OOM handling. It can also be a sort
of watermark-based decision.
> Sync migration at that state might
> be really non trivial (pages might be dirty, pinned etc...).
Non-trivial, yes, but we already have the code to move all allocations
away from MOVABLE block when we try to offline it, we can probably
leverage it.
> What about
> user expectation to hotremove that memory later, should we just break
> it? How do we inflate movable zone back?
I think that it's OK to leave this block non-offlineable for future. As
Andrea already pointed out it is not practical to try to guarantee we
can unplug everything we plugged in, we're talking about 'best effort'
service here anyway.
>
>> An alternative approach would be to have lists of memblocks which
>> constitute ZONE_NORMAL and ZONE_MOVABLE instead of a simple 'NORMAL
>> before MOVABLE' rule we have now but I'm not sure this is a viable
>> approach with the current code base.
>
> I am not sure I understand.
Now we have
[Normal][Normal][Normal][Movable][Movable][Movable]
we could have
[Normal][Normal][Movable][Normal][Movable][Normal]
so when new block comes in we make a decision to which zone we want to
online it (based on memory usage in these zones) and zone becomes a list
of memblocks which constitute it, not a simple [from..to] range.
--
Vitaly
--
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-03-15 12:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 9:13 [RFC PATCH] rework memory hotplug onlining Michal Hocko
2017-03-15 10:48 ` Vitaly Kuznetsov
2017-03-15 12:29 ` ZONE_NORMAL vs. ZONE_MOVABLE (was: Re: [RFC PATCH] rework memory hotplug onlining) Michal Hocko
2017-03-15 12:53 ` Vitaly Kuznetsov [this message]
2017-03-15 13:11 ` ZONE_NORMAL vs. ZONE_MOVABLE Michal Hocko
2017-03-15 16:37 ` Andrea Arcangeli
2017-03-16 5:31 ` Joonsoo Kim
2017-03-16 19:01 ` Andrea Arcangeli
2017-03-17 10:25 ` Igor Mammedov
2017-03-20 6:33 ` Joonsoo Kim
2017-03-30 7:55 ` Vlastimil Babka
2017-03-15 23:08 ` [RFC PATCH] rework memory hotplug onlining Kani, Toshimitsu
2017-03-16 8:54 ` Michal Hocko
2017-03-16 17:19 ` Kani, Toshimitsu
2017-03-16 17:40 ` Michal Hocko
2017-03-17 13:20 ` Michal Hocko
2017-03-21 14:09 ` Dan Williams
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=87k27qd7m2.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=aarcange@redhat.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=arbab@linux.vnet.ibm.com \
--cc=daniel.kiper@oracle.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=imammedo@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@kernel.org \
--cc=qiuxishi@huawei.com \
--cc=rientjes@google.com \
--cc=slaoub@gmail.com \
--cc=tangchen@cn.fujitsu.com \
--cc=toshi.kani@hpe.com \
--cc=vbabka@suse.cz \
--cc=xieyisheng1@huawei.com \
--cc=yasu.isimatu@gmail.com \
--cc=zhenzhang.zhang@huawei.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