Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-28 Thread Pingfan Liu
On Fri, Mar 1, 2019 at 11:04 AM Pingfan Liu wrote: > > Hi Borislav, > > Do you think the following patch is good at present? > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > index 81f9d23..9213073 100644 > --- a/arch/x86/kernel/setup.c > +++ b/arch/x86/kernel/setup.c > @@ -460,7

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-28 Thread Pingfan Liu
Hi Borislav, Do you think the following patch is good at present? diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 81f9d23..9213073 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -460,7 +460,7 @@ static void __init

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-25 Thread Borislav Petkov
On Mon, Feb 25, 2019 at 07:12:16PM +0800, Dave Young wrote: > If we move to high as default, it will allocate 160M high + 256M low. It We won't move to high by default - we will *fall* back to high if the default allocation fails. > To make the process less fragile maybe we can remove the 896M

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-25 Thread Dave Young
On 02/25/19 at 12:00pm, Joerg Roedel wrote: > On Fri, Feb 22, 2019 at 02:00:26PM +0100, Borislav Petkov wrote: > > On Fri, Feb 22, 2019 at 09:42:41AM +0100, Joerg Roedel wrote: > > > The current default of 256MB was found by experiments on a bigger > > > number of machines, to create a reasonable

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-25 Thread Joerg Roedel
On Fri, Feb 22, 2019 at 02:00:26PM +0100, Borislav Petkov wrote: > On Fri, Feb 22, 2019 at 09:42:41AM +0100, Joerg Roedel wrote: > > The current default of 256MB was found by experiments on a bigger > > number of machines, to create a reasonable default that is at least > > likely to be sufficient

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-25 Thread Borislav Petkov
On Sun, Feb 24, 2019 at 09:25:18PM +0800, Pingfan Liu wrote: > Maybe I misunderstood you, but does "requested range failed" mean that > user specify the range? If yes, then it should be the duty of user as > you said later, not the duty of kernel" No, it should say that it selected a different

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-24 Thread Dave Young
On 02/24/19 at 09:25pm, Pingfan Liu wrote: > On Fri, Feb 22, 2019 at 9:00 PM Borislav Petkov wrote: > > > > On Fri, Feb 22, 2019 at 09:42:41AM +0100, Joerg Roedel wrote: > > > The current default of 256MB was found by experiments on a bigger > > > number of machines, to create a reasonable

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-24 Thread Pingfan Liu
On Fri, Feb 22, 2019 at 9:00 PM Borislav Petkov wrote: > > On Fri, Feb 22, 2019 at 09:42:41AM +0100, Joerg Roedel wrote: > > The current default of 256MB was found by experiments on a bigger > > number of machines, to create a reasonable default that is at least > > likely to be sufficient of an

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-22 Thread Borislav Petkov
On Fri, Feb 22, 2019 at 09:42:41AM +0100, Joerg Roedel wrote: > The current default of 256MB was found by experiments on a bigger > number of machines, to create a reasonable default that is at least > likely to be sufficient of an average machine. Exactly, and this is what makes sense. The code

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-22 Thread Joerg Roedel
On Fri, Feb 22, 2019 at 10:11:01AM +0800, Dave Young wrote: > In case people have a lot of devices need more swiotlb, then he manually > set the ,high with ,low together. The option to specify the high and low values for the crashkernel are important for certain machines. The point is that

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-21 Thread Dave Young
On 02/21/19 at 06:13pm, Borislav Petkov wrote: > On Wed, Feb 20, 2019 at 05:41:46PM +0800, Dave Young wrote: > > Previously Joerg posted below patch, maybe he has some idea. Joerg? > > Isn't it clear from the commit message? Then, does it answered your question? 256M is set as a default value

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-21 Thread Borislav Petkov
On Wed, Feb 20, 2019 at 05:41:46PM +0800, Dave Young wrote: > Previously Joerg posted below patch, maybe he has some idea. Joerg? Isn't it clear from the commit message? -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-20 Thread Pingfan Liu
On Wed, Feb 20, 2019 at 5:41 PM Dave Young wrote: > > On 02/20/19 at 09:32am, Borislav Petkov wrote: > > On Mon, Feb 18, 2019 at 09:48:20AM +0800, Dave Young wrote: > > > It is ideal if kernel can do it automatically, but I'm not sure if > > > kernel can predict the swiotlb reserved size

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-20 Thread Dave Young
On 02/20/19 at 09:32am, Borislav Petkov wrote: > On Mon, Feb 18, 2019 at 09:48:20AM +0800, Dave Young wrote: > > It is ideal if kernel can do it automatically, but I'm not sure if > > kernel can predict the swiotlb reserved size automatically. > > Do you see how even more absurd this gets? > >

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-20 Thread Borislav Petkov
On Mon, Feb 18, 2019 at 09:48:20AM +0800, Dave Young wrote: > It is ideal if kernel can do it automatically, but I'm not sure if > kernel can predict the swiotlb reserved size automatically. Do you see how even more absurd this gets? If the kernel cannot know the swiotlb reserved size

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-19 Thread Pingfan Liu
On Mon, Feb 18, 2019 at 9:48 AM Dave Young wrote: > > On 02/15/19 at 11:24am, Borislav Petkov wrote: > > On Tue, Feb 12, 2019 at 04:48:16AM +0800, Dave Young wrote: > > > Even we make it automatic in kernel, but we have to have some default > > > value for swiotlb in case crashkernel can not find

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-17 Thread Dave Young
On 02/15/19 at 11:24am, Borislav Petkov wrote: > On Tue, Feb 12, 2019 at 04:48:16AM +0800, Dave Young wrote: > > Even we make it automatic in kernel, but we have to have some default > > value for swiotlb in case crashkernel can not find a free region under 4G. > > So this default value can not

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-15 Thread Borislav Petkov
On Tue, Feb 12, 2019 at 04:48:16AM +0800, Dave Young wrote: > Even we make it automatic in kernel, but we have to have some default > value for swiotlb in case crashkernel can not find a free region under 4G. > So this default value can not work for every use cases, people need > manually use

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-11 Thread Pingfan Liu
On Tue, Feb 12, 2019 at 4:48 AM Dave Young wrote: > > On 02/06/19 at 08:08pm, Dave Young wrote: > > On 02/05/19 at 09:15am, Borislav Petkov wrote: > > > On Mon, Feb 04, 2019 at 03:30:16PM -0700, Jerry Hoemann wrote: > > > > Is your objection only to the second fallback of allocating > > > >

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-11 Thread Dave Young
On 02/06/19 at 08:08pm, Dave Young wrote: > On 02/05/19 at 09:15am, Borislav Petkov wrote: > > On Mon, Feb 04, 2019 at 03:30:16PM -0700, Jerry Hoemann wrote: > > > Is your objection only to the second fallback of allocating > > > memory above >= 4GB? Or are you objecting to allocating from > > >

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-06 Thread Dave Young
On 02/05/19 at 09:15am, Borislav Petkov wrote: > On Mon, Feb 04, 2019 at 03:30:16PM -0700, Jerry Hoemann wrote: > > Is your objection only to the second fallback of allocating > > memory above >= 4GB? Or are you objecting to allocating from > > (896 .. 4GB) as well? > > My problem is why should

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-05 Thread Borislav Petkov
On Mon, Feb 04, 2019 at 03:30:16PM -0700, Jerry Hoemann wrote: > Is your objection only to the second fallback of allocating > memory above >= 4GB? Or are you objecting to allocating from > (896 .. 4GB) as well? My problem is why should the user need to specify high or low allocation explicitly

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-02-04 Thread Jerry Hoemann
On Fri, Feb 01, 2019 at 12:47:40AM +0100, Borislav Petkov wrote: > On Thu, Jan 31, 2019 at 03:27:32PM -0700, Jerry Hoemann wrote: > > So even if a system administrator is diligent and tests > > that a chosen kdump configuration works, that configuration > > might not work on some random reboot 7

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-31 Thread Borislav Petkov
On Thu, Jan 31, 2019 at 03:27:32PM -0700, Jerry Hoemann wrote: > So even if a system administrator is diligent and tests > that a chosen kdump configuration works, that configuration > might not work on some random reboot 7 months in the future. Jerry, did you read the rest of the thread where

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-31 Thread Jerry Hoemann
On Thu, Jan 31, 2019 at 11:57:32AM +0100, Borislav Petkov wrote: > On Thu, Jan 31, 2019 at 03:59:07PM +0800, Dave Young wrote: > > As Pingfan/me mentioned in another reply, there are two reasons: > > 1. old kexec-tools can not load kernel to high memory > > 2. ,high will not work on some systems

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-31 Thread Borislav Petkov
On Thu, Jan 31, 2019 at 03:59:07PM +0800, Dave Young wrote: > As Pingfan/me mentioned in another reply, there are two reasons: > 1. old kexec-tools can not load kernel to high memory > 2. ,high will not work on some systems without some amounts of low > memory so it nees reserve extra low memory,

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-31 Thread Borislav Petkov
On Tue, Jan 29, 2019 at 01:51:45PM +0800, Pingfan Liu wrote: > Sorry, can not catch up with you. Do you suggestion > memblock_find_in_range(0, kernel_start) and > memblock_find_in_range(kernel_end, mem_end)? But the memory is > truncated into fraction by many component which call >

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-30 Thread Dave Young
On 01/25/19 at 03:08pm, Borislav Petkov wrote: > On Fri, Jan 25, 2019 at 09:45:18PM +0800, Dave Young wrote: > > AFAIK, some people prefer to explictly reserve crash memory at high > > region even if it is possible to reserve at low area. May because > > <4G memory is limited on large server,

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-30 Thread Dave Young
On 01/29/19 at 01:25pm, Pingfan Liu wrote: > On Fri, Jan 25, 2019 at 10:08 PM Borislav Petkov wrote: > > > > On Fri, Jan 25, 2019 at 09:45:18PM +0800, Dave Young wrote: > > > AFAIK, some people prefer to explictly reserve crash memory at high > > > region even if it is possible to reserve at low

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-28 Thread Pingfan Liu
On Fri, Jan 25, 2019 at 6:39 PM Borislav Petkov wrote: > > > > Subject: Re: [PATCHv7] x86/kdump: bugfix, make the behavior of > > crashkernel=X > > s/bugfix, // > OK. > On Mon, Jan 21, 2019 at 01:16:08PM +0800, Pingfan Liu wrote: > > People reported crashkernel=384M reservation failed on a

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-28 Thread Pingfan Liu
On Fri, Jan 25, 2019 at 10:08 PM Borislav Petkov wrote: > > On Fri, Jan 25, 2019 at 09:45:18PM +0800, Dave Young wrote: > > AFAIK, some people prefer to explictly reserve crash memory at high > > region even if it is possible to reserve at low area. May because > > <4G memory is limited on large

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-28 Thread Borislav Petkov
On Mon, Jan 28, 2019 at 05:58:09PM +0800, Dave Young wrote: > Another reason is in case ,high we will need automatically reserve a > region in low area for swiotlb. So for example one use > crashkernel=256M,high, actual reserved memory is 256M above 4G and > another 256M under 4G for swiotlb.

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-28 Thread Dave Young
On 01/25/19 at 03:08pm, Borislav Petkov wrote: > On Fri, Jan 25, 2019 at 09:45:18PM +0800, Dave Young wrote: > > AFAIK, some people prefer to explictly reserve crash memory at high > > region even if it is possible to reserve at low area. May because > > <4G memory is limited on large server,

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-25 Thread Borislav Petkov
On Fri, Jan 25, 2019 at 09:45:18PM +0800, Dave Young wrote: > AFAIK, some people prefer to explictly reserve crash memory at high > region even if it is possible to reserve at low area. May because > <4G memory is limited on large server, they want to leave this for other > use. > > Yinghai or

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-25 Thread Dave Young
> > > > Dave Young sent the original post, and I just re-post it with commit log > > If he sent it, he should be the author I guess. Just drop the line, but can change the credit to Chao Wang since he did it initially. But Chao does not work on kexec/kdump any more, and the email address is

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-25 Thread Borislav Petkov
> Subject: Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X s/bugfix, // On Mon, Jan 21, 2019 at 01:16:08PM +0800, Pingfan Liu wrote: > People reported crashkernel=384M reservation failed on a high end server > with KASLR enabled. In that case there is enough free memory

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-21 Thread Pingfan Liu
On Sat, Jan 19, 2019 at 9:25 AM Jerry Hoemann wrote: > > On Tue, Jan 15, 2019 at 04:07:03PM +0800, Pingfan Liu wrote: > > People reported a bug on a high end server with many pcie devices, where > > kernel bootup with crashkernel=384M, and kaslr is enabled. Even > > though we still see much

[PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-20 Thread Pingfan Liu
People reported crashkernel=384M reservation failed on a high end server with KASLR enabled. In that case there is enough free memory under 896M but crashkernel reservation still fails intermittently. The situation is crashkernel reservation code only finds free region under 896 MB with 128M

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-20 Thread Baoquan He
On 01/21/19 at 01:16pm, Pingfan Liu wrote: > People reported crashkernel=384M reservation failed on a high end server > with KASLR enabled. In that case there is enough free memory under 896M > but crashkernel reservation still fails intermittently. > > The situation is crashkernel reservation

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-18 Thread Jerry Hoemann
On Tue, Jan 15, 2019 at 04:07:03PM +0800, Pingfan Liu wrote: > People reported a bug on a high end server with many pcie devices, where > kernel bootup with crashkernel=384M, and kaslr is enabled. Even > though we still see much memory under 896 MB, the finding still failed > intermittently.

Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-17 Thread Dave Young
Pingfan, thanks for the post. On 01/15/19 at 04:07pm, Pingfan Liu wrote: > People reported a bug on a high end server with many pcie devices, where > kernel bootup with crashkernel=384M, and kaslr is enabled. Even > though we still see much memory under 896 MB, the finding still failed >

[PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr

2019-01-15 Thread Pingfan Liu
People reported a bug on a high end server with many pcie devices, where kernel bootup with crashkernel=384M, and kaslr is enabled. Even though we still see much memory under 896 MB, the finding still failed intermittently. Because currently we can only find region under 896 MB, if without ',high'