Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-17 Thread Thomas Gleixner
On Mon, 17 Sep 2018, Feng Tang wrote: > > Below is a patch against 4.19-rc4, verified with earlycon > working fine, please review, thanks! Aside of the whitespace damage this looks about right. Care to send a proper patch? Thanks, tglx

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-16 Thread Feng Tang
Hi Thomas, On Sun, Sep 16, 2018 at 11:06:41PM +0800, Feng Tang wrote: > Hi Thomas, > > On Sun, Sep 16, 2018 at 04:43:55PM +0200, Thomas Gleixner wrote: > > On Sun, 16 Sep 2018, Feng Tang wrote: > > > diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c > > > index e848a4811785..a927f5f39bee

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-16 Thread Feng Tang
Hi Thomas, On Sun, Sep 16, 2018 at 04:43:55PM +0200, Thomas Gleixner wrote: > On Sun, 16 Sep 2018, Feng Tang wrote: > > diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c > > index e848a4811785..a927f5f39bee 100644 > > --- a/arch/x86/mm/pgtable.c > > +++ b/arch/x86/mm/pgtable.c > > @@ -637

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-16 Thread Thomas Gleixner
On Sun, 16 Sep 2018, Feng Tang wrote: > diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c > index e848a4811785..a927f5f39bee 100644 > --- a/arch/x86/mm/pgtable.c > +++ b/arch/x86/mm/pgtable.c > @@ -637,6 +637,16 @@ void __native_set_fixmap(enum fixed_addresses idx, pte_t > pte) > { >

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-16 Thread Feng Tang
On Sat, Sep 15, 2018 at 07:28:03PM +0200, Thomas Gleixner wrote: > On Sun, 16 Sep 2018, Feng Tang wrote: > > I have tried to change some header files incluing fixmap.h/apicdef.h/ > > vsyscall.h, and most of the .c files compile fine now, but I can not > > use the "__end_of_permanent_fixed_addresses

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-15 Thread Thomas Gleixner
On Sun, 16 Sep 2018, Feng Tang wrote: > I have tried to change some header files incluing fixmap.h/apicdef.h/ > vsyscall.h, and most of the .c files compile fine now, but I can not > use the "__end_of_permanent_fixed_addresses" in head_64.S as it is a > enum type, and could not be recognized by as

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-15 Thread Feng Tang
Hi Thomas, On Sat, Sep 15, 2018 at 12:29:50PM +0200, Thomas Gleixner wrote: > On Tue, 11 Sep 2018, Feng Tang wrote: > > Thanks for the suggestion, and I have 2 patches: one adds a build warning, > > > > the other prepares fixmap page table on demand and doesn't need warning. > > The latter pl

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-15 Thread Thomas Gleixner
On Tue, 11 Sep 2018, Feng Tang wrote: > Thanks for the suggestion, and I have 2 patches: one adds a build warning, > the other prepares fixmap page table on demand and doesn't need warning. The latter please. > But I met a problem, that the "__end_of_permanent_fixed_addresses" is > defined in

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-10 Thread Feng Tang
Hi Thomas, On Mon, Sep 10, 2018 at 11:53:39AM +0200, Thomas Gleixner wrote: > On Mon, 10 Sep 2018, Feng Tang wrote: > > diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c > > index e848a4811785..fc172551048a 100644 > > --- a/arch/x86/mm/pgtable.c > > +++ b/arch/x86/mm/pgtable.c > > @@ -637

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-10 Thread Thomas Gleixner
On Mon, 10 Sep 2018, Feng Tang wrote: > On Fri, Sep 07, 2018 at 12:52:17PM +0200, Thomas Gleixner wrote: > > You really want to add a proper sanity check for this. The static stuff has > > to cover the fixmap. Just making it work for this particular case is sloppy > > at best as the next larger cha

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-10 Thread Feng Tang
On Fri, Sep 07, 2018 at 12:52:17PM +0200, Thomas Gleixner wrote: > On Fri, 7 Sep 2018, Feng Tang wrote: > > On Fri, Aug 31, 2018 at 09:36:59PM +0800, Feng Tang wrote: > > > Any sugestion? I can only have patch like this: > > > > Could you review this patch, as at this time window there is no usabl

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-07 Thread Thomas Gleixner
On Fri, 7 Sep 2018, Feng Tang wrote: > On Fri, Aug 31, 2018 at 09:36:59PM +0800, Feng Tang wrote: > > Any sugestion? I can only have patch like this: > > Could you review this patch, as at this time window there is no usable memory > block or other memory allocators that I know, so I follow the ex

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-09-07 Thread Feng Tang
Hi Thomas, On Fri, Aug 31, 2018 at 09:36:59PM +0800, Feng Tang wrote: > On Fri, Aug 31, 2018 at 01:33:05PM +0200, Thomas Gleixner wrote: > > On Fri, 31 Aug 2018, Feng Tang wrote: > > > On Thu, Aug 30, 2018 at 03:25:42PM +0200, Thomas Gleixner wrote: > > > This panic happens as the earlycon's fixma

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-31 Thread Feng Tang
On Fri, Aug 31, 2018 at 01:33:05PM +0200, Thomas Gleixner wrote: > On Fri, 31 Aug 2018, Feng Tang wrote: > > On Thu, Aug 30, 2018 at 03:25:42PM +0200, Thomas Gleixner wrote: > > This panic happens as the earlycon's fixmap address has no > > pmd/pte ready, and __set_fixmap will try to allocate memor

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-31 Thread Thomas Gleixner
On Fri, 31 Aug 2018, Feng Tang wrote: > On Thu, Aug 30, 2018 at 03:25:42PM +0200, Thomas Gleixner wrote: > This panic happens as the earlycon's fixmap address has no > pmd/pte ready, and __set_fixmap will try to allocate memory to > setup the page table, and trigger panic due to no memory. > > x86

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Feng Tang
On Thu, Aug 30, 2018 at 03:25:42PM +0200, Thomas Gleixner wrote: > And where is the problem? We know that we need the fixmap during early boot > anyway, so allocating the PTE page statically and setting it up early > enough is not really rocket science. No allocator required. Further check shows

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Feng Tang
On Thu, Aug 30, 2018 at 03:25:42PM +0200, Thomas Gleixner wrote: > On Thu, 30 Aug 2018, Feng Tang wrote: > > On Thu, Aug 30, 2018 at 03:05:31PM +0200, Thomas Gleixner wrote: > > > > Those [_text, __bss_stop] is not able to be used by alloc_bootmem(). > > > > And I > > > > only got this patch, and

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Thomas Gleixner
On Thu, 30 Aug 2018, Feng Tang wrote: > On Thu, Aug 30, 2018 at 03:05:31PM +0200, Thomas Gleixner wrote: > > > Those [_text, __bss_stop] is not able to be used by alloc_bootmem(). And I > > > only got this patch, and really appreciate any good suggestions. > > > > And why do you want to use bootme

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Feng Tang
Hi Thomas, On Thu, Aug 30, 2018 at 03:05:31PM +0200, Thomas Gleixner wrote: > On Thu, 30 Aug 2018, Feng Tang wrote: > > On Thu, Aug 30, 2018 at 02:49:15PM +0200, Michal Hocko wrote: > > > On Thu 30-08-18 13:54:19, Thomas Gleixner wrote: > > > > On Thu, 30 Aug 2018, Michal Hocko wrote: > > > > > On

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Thomas Gleixner
On Thu, 30 Aug 2018, Feng Tang wrote: > On Thu, Aug 30, 2018 at 02:49:15PM +0200, Michal Hocko wrote: > > On Thu 30-08-18 13:54:19, Thomas Gleixner wrote: > > > On Thu, 30 Aug 2018, Michal Hocko wrote: > > > > On Thu 30-08-18 12:44:02, Peter Zijlstra wrote: > > > > > On Thu, Aug 30, 2018 at 05:03:1

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Feng Tang
On Thu, Aug 30, 2018 at 02:49:15PM +0200, Michal Hocko wrote: > On Thu 30-08-18 13:54:19, Thomas Gleixner wrote: > > On Thu, 30 Aug 2018, Michal Hocko wrote: > > > On Thu 30-08-18 12:44:02, Peter Zijlstra wrote: > > > > On Thu, Aug 30, 2018 at 05:03:19PM +0800, Feng Tang wrote: > > > > > The root c

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Michal Hocko
On Thu 30-08-18 13:54:19, Thomas Gleixner wrote: > On Thu, 30 Aug 2018, Michal Hocko wrote: > > On Thu 30-08-18 12:44:02, Peter Zijlstra wrote: > > > On Thu, Aug 30, 2018 at 05:03:19PM +0800, Feng Tang wrote: > > > > The root cause is that when CONFIG_NO_BOOTMEM=y, before > > > > e820__memblock_se

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Michal Hocko
On Thu 30-08-18 14:09:26, Peter Zijlstra wrote: > On Thu, Aug 30, 2018 at 01:12:07PM +0200, Michal Hocko wrote: > > On Thu 30-08-18 12:44:02, Peter Zijlstra wrote: > > > On Thu, Aug 30, 2018 at 05:03:19PM +0800, Feng Tang wrote: > > > > We hit a kernel panic when enabling earlycon for a platform, t

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Feng Tang
Hi Peter, On Thu, Aug 30, 2018 at 12:44:02PM +0200, Peter Zijlstra wrote: > On Thu, Aug 30, 2018 at 05:03:19PM +0800, Feng Tang wrote: > > We hit a kernel panic when enabling earlycon for a platform, the > > call trace is: > > > > panic+0xd2/0x220 > > __alloc_bootmem+0x31/0x34 > >

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Peter Zijlstra
On Thu, Aug 30, 2018 at 01:12:07PM +0200, Michal Hocko wrote: > On Thu 30-08-18 12:44:02, Peter Zijlstra wrote: > > On Thu, Aug 30, 2018 at 05:03:19PM +0800, Feng Tang wrote: > > > We hit a kernel panic when enabling earlycon for a platform, the > > > call trace is: > > > > > > panic+0xd2/0x22

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Thomas Gleixner
On Thu, 30 Aug 2018, Michal Hocko wrote: > On Thu 30-08-18 12:44:02, Peter Zijlstra wrote: > > On Thu, Aug 30, 2018 at 05:03:19PM +0800, Feng Tang wrote: > > > The root cause is that when CONFIG_NO_BOOTMEM=y, before > > > e820__memblock_setup() is called there is no memory for bootmem > > > to all

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Michal Hocko
On Thu 30-08-18 12:44:02, Peter Zijlstra wrote: > On Thu, Aug 30, 2018 at 05:03:19PM +0800, Feng Tang wrote: > > We hit a kernel panic when enabling earlycon for a platform, the > > call trace is: > > > > panic+0xd2/0x220 > > __alloc_bootmem+0x31/0x34 > > spp_getpage+0x60/0x8a >

Re: [PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Peter Zijlstra
On Thu, Aug 30, 2018 at 05:03:19PM +0800, Feng Tang wrote: > We hit a kernel panic when enabling earlycon for a platform, the > call trace is: > > panic+0xd2/0x220 > __alloc_bootmem+0x31/0x34 > spp_getpage+0x60/0x8a > fill_pte+0x71/0x130 > __set_pte_vaddr+0x

[PATCH] x86, mm: Reserver some memory for bootmem allocator for NO_BOOTMEM

2018-08-30 Thread Feng Tang
We hit a kernel panic when enabling earlycon for a platform, the call trace is: panic+0xd2/0x220 __alloc_bootmem+0x31/0x34 spp_getpage+0x60/0x8a fill_pte+0x71/0x130 __set_pte_vaddr+0x1d/0x50 set_pte_vaddr+0x3c/0x60 __native_set_