Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-17 Thread Michal Hocko
On Tue 17-07-18 09:51:20, Baoquan He wrote: > On 07/16/18 at 05:24pm, Michal Hocko wrote: > > 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

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-16 Thread Baoquan He
On 07/16/18 at 05:24pm, Michal Hocko wrote: > 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

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-16 Thread Michal Hocko
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. Co

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-16 Thread Baoquan He
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?

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-16 Thread Michal Hocko
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 "kerne

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-12 Thread Chao Fan
On Fri, Jul 13, 2018 at 07:52:40AM +0800, Baoquan He wrote: >Hi Michal, > >On 07/12/18 at 02:32pm, Michal Hocko wrote: >> On Thu 12-07-18 14:01:15, Chao Fan wrote: >> > On Thu, Jul 12, 2018 at 01:49:49PM +0800, Dou Liyang wrote: >> > >Hi Baoquan, >> > > >> > >At 07/11/2018 08:40 PM, Baoquan He wrot

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-12 Thread Baoquan He
Hi Michal, On 07/12/18 at 02:32pm, Michal Hocko wrote: > On Thu 12-07-18 14:01:15, Chao Fan wrote: > > On Thu, Jul 12, 2018 at 01:49:49PM +0800, Dou Liyang wrote: > > >Hi Baoquan, > > > > > >At 07/11/2018 08:40 PM, Baoquan He wrote: > > >> Please try this v3 patch: > > >> >>From 9850d3de9c02e570dc

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-12 Thread Michal Hocko
On Thu 12-07-18 14:01:15, Chao Fan wrote: > On Thu, Jul 12, 2018 at 01:49:49PM +0800, Dou Liyang wrote: > >Hi Baoquan, > > > >At 07/11/2018 08:40 PM, Baoquan He wrote: > >> Please try this v3 patch: > >> >>From 9850d3de9c02e570dc7572069a9749a8add4c4c7 Mon Sep 17 00:00:00 2001 > >> From: Baoquan He

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-12 Thread Baoquan He
On 07/12/18 at 09:19am, Chao Fan wrote: > On Wed, Jul 11, 2018 at 08:40:08PM +0800, Baoquan He wrote: > >Please try this v3 patch: > > > >From 9850d3de9c02e570dc7572069a9749a8add4c4c7 Mon Sep 17 00:00:00 2001 > >From: Baoquan He > >Date: Wed, 11 Jul 2018 20:31:51 +0800 > >Subject: [PATCH v3] mm, p

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Chao Fan
On Thu, Jul 12, 2018 at 01:49:49PM +0800, Dou Liyang wrote: >Hi Baoquan, > >At 07/11/2018 08:40 PM, Baoquan He wrote: >> Please try this v3 patch: >> >>From 9850d3de9c02e570dc7572069a9749a8add4c4c7 Mon Sep 17 00:00:00 2001 >> From: Baoquan He >> Date: Wed, 11 Jul 2018 20:31:51 +0800 >> Subject: [P

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Dou Liyang
Hi Baoquan, At 07/11/2018 08:40 PM, Baoquan He wrote: Please try this v3 patch: >>From 9850d3de9c02e570dc7572069a9749a8add4c4c7 Mon Sep 17 00:00:00 2001 From: Baoquan He Date: Wed, 11 Jul 2018 20:31:51 +0800 Subject: [PATCH v3] mm, page_alloc: find movable zone after kernel text In find_zone_m

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Chao Fan
On Wed, Jul 11, 2018 at 08:40:08PM +0800, Baoquan He wrote: >Please try this v3 patch: > >From 9850d3de9c02e570dc7572069a9749a8add4c4c7 Mon Sep 17 00:00:00 2001 >From: Baoquan He >Date: Wed, 11 Jul 2018 20:31:51 +0800 >Subject: [PATCH v3] mm, page_alloc: find movable zone after kernel text > >In f

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Baoquan He
On 07/11/18 at 06:49pm, Baoquan He wrote: > On 07/11/18 at 06:41pm, Baoquan He wrote: > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > > index 1521100..fe346b4 100644 > > --- a/mm/page_alloc.c > > +++ b/mm/page_alloc.c > > @@ -6678,6 +6678,8 @@ static void __init > > find_zone_movable_pfns_for

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Baoquan He
Please try this v3 patch: >From 9850d3de9c02e570dc7572069a9749a8add4c4c7 Mon Sep 17 00:00:00 2001 From: Baoquan He Date: Wed, 11 Jul 2018 20:31:51 +0800 Subject: [PATCH v3] mm, page_alloc: find movable zone after kernel text In find_zone_movable_pfns_for_nodes(), when try to find the starting PF

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Baoquan He
On 07/11/18 at 06:41pm, Baoquan He wrote: > Hmm, it's an issue, worth fixing it. Otherwise the size of > movable area will be smaller than we expect when add "kernel_core=" > or "movable_core=". > > Add a check in find_zone_movable_pfns_for_nodes(), and use min() to get > the starting address of

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Baoquan He
On 07/11/18 at 05:42pm, Chao Fan wrote: > Hi all, > > I found there is a BUG about KASLR and ZONE_MOVABLE. > > When users use 'kernelcore=' parameter without 'movable_node', > movable memory is evenly distributed to all nodes. The size of > ZONE_MOVABLE depends on the kernel parameter 'kernelcore

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Chao Fan
More explanation: If there is a machine with 10 nodes, and memory size in each node is 20G. Then 'kernelcore=100G' will set last 10G memory in each node as ZONE_MOVABLE. But if KASLR put kernel to 19G position of first node, the regions can not be offlined. So we should set the last 1G of first ke

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Chao Fan
On Wed, Jul 11, 2018 at 05:42:44PM +0800, Chao Fan wrote: >Hi all, > >I found there is a BUG about KASLR and ZONE_MOVABLE. > >When users use 'kernelcore=' parameter without 'movable_node', >movable memory is evenly distributed to all nodes. The size of >ZONE_MOVABLE depends on the kernel parameter

Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Chao Fan
Hi all, I found there is a BUG about KASLR and ZONE_MOVABLE. When users use 'kernelcore=' parameter without 'movable_node', movable memory is evenly distributed to all nodes. The size of ZONE_MOVABLE depends on the kernel parameter 'kernelcore=' and 'movablecore='. But sometiomes, KASLR may put t