From: Michal Hocko <mhocko@kernel.org>
To: Baoquan He <bhe@redhat.com>
Cc: Chao Fan <fanc.fnst@cn.fujitsu.com>,
Dou Liyang <douly.fnst@cn.fujitsu.com>,
akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, x86@kernel.org,
yasu.isimatu@gmail.com, keescook@chromium.org,
indou.takao@jp.fujitsu.com, caoj.fnst@cn.fujitsu.com,
vbabka@suse.cz, mgorman@techsingularity.net
Subject: Re: Bug report about KASLR and ZONE_MOVABLE
Date: Mon, 16 Jul 2018 17:24:10 +0200 [thread overview]
Message-ID: <20180716152410.GU17280@dhcp22.suse.cz> (raw)
In-Reply-To: <20180716130202.GB1724@MiWiFi-R3L-srv>
On Mon 16-07-18 21:02:02, Baoquan He wrote:
> On 07/16/18 at 01:38pm, Michal Hocko wrote:
> > On Fri 13-07-18 07:52:40, Baoquan He wrote:
> > > Hi Michal,
> > >
> > > On 07/12/18 at 02:32pm, Michal Hocko wrote:
> > [...]
> > > > I am not able to find the beginning of the email thread right now. Could
> > > > you summarize what is the actual problem please?
> > >
> > > The bug is found on x86 now.
> > >
> > > When added "kernelcore=" or "movablecore=" into kernel command line,
> > > kernel memory is spread evenly among nodes. However, this is right when
> > > KASLR is not enabled, then kernel will be at 16M of place in x86 arch.
> > > If KASLR enabled, it could be put any place from 16M to 64T randomly.
> > >
> > > Consider a scenario, we have 10 nodes, and each node has 20G memory, and
> > > we specify "kernelcore=50%", means each node will take 10G for
> > > kernelcore, 10G for movable area. But this doesn't take kernel position
> > > into consideration. E.g if kernel is put at 15G of 2nd node, namely
> > > node1. Then we think on node1 there's 10G for kernelcore, 10G for
> > > movable, in fact there's only 5G available for movable, just after
> > > kernel.
> >
> > OK, I guess I see that part. But who is going to use movablecore along
> > with KASLR enabled? I mean do we really have to support those two
> > obscure command line parameters for KASLR?
>
> Not very sure whether we have to support both of those to work with
> KASLR. Maybe it's time to make clear of it now.
Yes, I would really like to deprecate this. It is an ugly piece of code
and it's far from easily maintainable as well.
> For 'kernelcore=mirror', we have solved the conflict to make it work well
> with KASLR. For 'movable_node' conflict with KASLR, Chao is posting
> patches to fix it. As for 'kernelcore=' and 'movablecore=',
>
> 1) solve the conflict between them with KASLR in
> find_zone_movable_pfns_for_nodes();
> 2) disable KASLR when 'kernelcore=' | 'movablecore=' is set;
> 3) disable 'kernelcore=' | 'movablecore=' when KASLR is enabled;
> 4) add note in doc to notice people to not add them at the same time;
I would simply warn that those kernel parameters are not supported
anymore. If somebody shows up with a valid usecase we can reconsider.
> 2) and 3) may need be fixed in arch/x86 code. As long as come to an
> agreement, any one is fine to me.
> >
> > In fact I would be much more concerned about memory hotplug and
> > pre-defined movable nodes. Does the current KASLR code work in that
> > case?
>
> As said above, kernelcore=mirror works well with KASLR now. Making
> 'movable_node' work with KASLR is in progress.
OK, thanks for the info.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2018-07-16 15:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180711094244.GA2019@localhost.localdomain>
2018-07-11 10:41 ` Baoquan He
2018-07-11 10:49 ` Baoquan He
2018-07-11 12:40 ` Baoquan He
2018-07-11 17:59 ` [PATCH v3] mm, page_alloc: find movable zone after kernel text kbuild test robot
2018-07-11 19:02 ` kbuild test robot
2018-07-12 1:19 ` Bug report about KASLR and ZONE_MOVABLE Chao Fan
2018-07-12 12:08 ` Baoquan He
2018-07-12 5:49 ` Dou Liyang
2018-07-12 6:01 ` Chao Fan
2018-07-12 12:32 ` Michal Hocko
2018-07-12 23:52 ` Baoquan He
2018-07-13 1:44 ` Chao Fan
2018-07-16 11:38 ` Michal Hocko
2018-07-16 13:02 ` Baoquan He
2018-07-16 15:24 ` Michal Hocko [this message]
2018-07-17 1:51 ` Baoquan He
2018-07-17 8:22 ` Michal Hocko
2018-07-11 12:41 ` Baoquan He
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=20180716152410.GU17280@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bhe@redhat.com \
--cc=caoj.fnst@cn.fujitsu.com \
--cc=douly.fnst@cn.fujitsu.com \
--cc=fanc.fnst@cn.fujitsu.com \
--cc=indou.takao@jp.fujitsu.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=vbabka@suse.cz \
--cc=x86@kernel.org \
--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