[PATCH] arc/Kconfig: add the "Memory Management" menu around include mm/Kconfig

2018-06-30 Thread Mike Rapoport
Otherwise mm configuration options show up in the top level menu. Suggested-by: Randy Dunlap Signed-off-by: Mike Rapoport Tested-by: Randy Dunlap Acked-by: Randy Dunlap --- arch/arc/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig index

Re: [PATCH v2 4/6] arm64: Utilize phys_initrd_start/phys_initrd_size

2018-10-31 Thread Mike Rapoport
On Tue, Oct 30, 2018 at 04:07:19PM -0700, Florian Fainelli wrote: > ARM64 is the only architecture that re-defines > __early_init_dt_declare_initrd() in order for that function to populate > initrd_start/initrd_end with physical addresses instead of virtual > addresses. Instead of having an

Re: [PATCH v2 0/2] arm64: Cut rebuild time when changing CONFIG_BLK_DEV_INITRD

2018-10-25 Thread Mike Rapoport
On Thu, Oct 25, 2018 at 08:15:15AM -0500, Rob Herring wrote: > +Ard > > On Thu, Oct 25, 2018 at 4:38 AM Mike Rapoport wrote: > > > > On Wed, Oct 24, 2018 at 02:55:17PM -0500, Rob Herring wrote: > > > On Wed, Oct 24, 2018 at 2:33 PM Florian Fainelli >

Re: [PATCH v2 0/2] arm64: Cut rebuild time when changing CONFIG_BLK_DEV_INITRD

2018-10-26 Thread Mike Rapoport
On Thu, Oct 25, 2018 at 04:13:10PM -0500, Rob Herring wrote: > On Thu, Oct 25, 2018 at 12:30 PM Mike Rapoport wrote: > > > > On Thu, Oct 25, 2018 at 08:15:15AM -0500, Rob Herring wrote: > > > +Ard > > > > > > On Thu, Oct 25, 2018 at 4:38 AM Mike Rapop

Re: [PATCH v2 0/2] arm64: Cut rebuild time when changing CONFIG_BLK_DEV_INITRD

2018-10-25 Thread Mike Rapoport
On Wed, Oct 24, 2018 at 02:55:17PM -0500, Rob Herring wrote: > On Wed, Oct 24, 2018 at 2:33 PM Florian Fainelli wrote: > > > > Hi all, > > > > While investigating why ARM64 required a ton of objects to be rebuilt > > when toggling CONFIG_DEV_BLK_INITRD, it became clear that this was > > because

Re: [PATCH v2 0/2] arm64: Cut rebuild time when changing CONFIG_BLK_DEV_INITRD

2018-10-26 Thread Mike Rapoport
On Thu, Oct 25, 2018 at 04:07:13PM -0700, Florian Fainelli wrote: > On 10/25/18 2:13 PM, Rob Herring wrote: > > On Thu, Oct 25, 2018 at 12:30 PM Mike Rapoport wrote: > >> > >> On Thu, Oct 25, 2018 at 08:15:15AM -0500, Rob Herring wrote: > >>> +Ard > >

Re: [PATCH v4 0/6] arm64: Get rid of __early_init_dt_declare_initrd()

2018-11-06 Thread Mike Rapoport
move custom __early_init_dt_declare_initrd() implementation > arch: Move initrd= parsing into do_mounts_initrd.c For the series: Reviewed-by: Mike Rapoport > arch/arc/mm/init.c | 25 +--- > arch/arm/mm/init.c | 28 ++--

Re: [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK

2018-09-26 Thread Mike Rapoport
On Wed, Sep 26, 2018 at 11:24:04AM +0200, Michal Hocko wrote: > On Fri 14-09-18 15:10:18, Mike Rapoport wrote: > > All architecures use memblock for early memory management. There is no need > > for the CONFIG_HAVE_MEMBLOCK configuration option. > > git grep says > ar

Re: [PATCH 02/30] mm: remove CONFIG_NO_BOOTMEM

2018-09-26 Thread Mike Rapoport
On Wed, Sep 26, 2018 at 11:22:39AM +0200, Michal Hocko wrote: > On Fri 14-09-18 15:10:17, Mike Rapoport wrote: > > All achitectures select NO_BOOTMEM which essentially becomes 'Y' for any > > kernel configuration and therefore it can be removed. > &

Re: [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK

2018-09-26 Thread Mike Rapoport
On Wed, Sep 26, 2018 at 09:58:41AM -0700, Alexander Duyck wrote: > On Fri, Sep 14, 2018 at 5:11 AM Mike Rapoport wrote: > > > > All architecures use memblock for early memory management. There is no need > > for the CONFIG_HAVE_MEMBLOCK configuration option. > > >

Re: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node()

2018-09-26 Thread Mike Rapoport
On Wed, Sep 26, 2018 at 11:36:48AM +0200, Michal Hocko wrote: > On Wed 26-09-18 11:31:27, Michal Hocko wrote: > > On Fri 14-09-18 15:10:29, Mike Rapoport wrote: > > > With the align parameter memblock_alloc_node() can be used as drop in > > > replacement f

Re: [PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK

2018-09-26 Thread Mike Rapoport
On Wed, Sep 26, 2018 at 05:34:32PM -0700, Alexander Duyck wrote: > On Wed, Sep 26, 2018 at 11:32 AM Mike Rapoport > wrote: > > > > On Wed, Sep 26, 2018 at 09:58:41AM -0700, Alexander Duyck wrote: > > > On Fri, Sep 14, 2018 at 5:11 AM Mike Rapoport > > > wro

[PATCH 08/21] memblock: drop __memblock_alloc_base()

2019-01-16 Thread Mike Rapoport
The __memblock_alloc_base() function tries to allocate a memory up to the limit specified by its max_addr parameter. Depending on the value of this parameter, the __memblock_alloc_base() can is replaced with the appropriate memblock_phys_alloc*() variant. Signed-off-by: Mike Rapoport --- arch

[PATCH 09/21] memblock: drop memblock_alloc_base()

2019-01-16 Thread Mike Rapoport
The memblock_alloc_base() function tries to allocate a memory up to the limit specified by its max_addr parameter and panics if the allocation fails. Replace its usage with memblock_phys_alloc_range() and make the callers check the return value and panic in case of error. Signed-off-by: Mike

[PATCH 05/21] memblock: emphasize that memblock_alloc_range() returns a physical address

2019-01-16 Thread Mike Rapoport
. Signed-off-by: Mike Rapoport --- include/linux/memblock.h | 5 ++--- mm/cma.c | 10 -- mm/memblock.c| 9 + 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index f7ef313..66dfdb3 100644

[PATCH 04/21] memblock: drop memblock_alloc_base_nid()

2019-01-16 Thread Mike Rapoport
The memblock_alloc_base_nid() is a oneliner wrapper for memblock_alloc_range_nid() without any side effect. Replace it's usage by the direct calls to memblock_alloc_range_nid(). Signed-off-by: Mike Rapoport --- include/linux/memblock.h | 3 --- mm/memblock.c| 15 --- 2

[PATCH 18/21] swiotlb: add checks for the return value of memblock_alloc*()

2019-01-16 Thread Mike Rapoport
Add panic() calls if memblock_alloc() returns NULL. The panic() format duplicates the one used by memblock itself and in order to avoid explosion with long parameters list replace open coded allocation size calculations with a local variable. Signed-off-by: Mike Rapoport --- kernel/dma

[PATCH 19/21] treewide: add checks for the return value of memblock_alloc*()

2019-01-16 Thread Mike Rapoport
the one below with manual massaging of format strings. @@ expression ptr, size, align; @@ ptr = memblock_alloc(size, align); + if (!ptr) + panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, size, align); Signed-off-by: Mike Rapoport --- arch/alpha/kernel/

[PATCH 17/21] init/main: add checks for the return value of memblock_alloc*()

2019-01-16 Thread Mike Rapoport
Add panic() calls if memblock_alloc() returns NULL. The panic() format duplicates the one used by memblock itself and in order to avoid explosion with long parameters list replace open coded allocation size calculations with a local variable. Signed-off-by: Mike Rapoport --- init/main.c | 26

[PATCH 00/21] Refine memblock API

2019-01-16 Thread Mike Rapoport
memblock. Christophe Leroy (1): powerpc: use memblock functions returning virtual address Mike Rapoport (20): openrisc: prefer memblock APIs returning virtual address memblock: replace memblock_alloc_base(ANYWHERE) with memblock_phys_alloc memblock: drop memblock_alloc_base_nid() memblock

[PATCH 01/21] openrisc: prefer memblock APIs returning virtual address

2019-01-16 Thread Mike Rapoport
The allocation of the page tables memory in openrics uses memblock_phys_alloc() and then converts the returned physical address to virtual one. Use memblock_alloc_raw() and add a panic() if the allocation fails. Signed-off-by: Mike Rapoport --- arch/openrisc/mm/init.c | 5 - 1 file changed

[PATCH 02/21] powerpc: use memblock functions returning virtual address

2019-01-16 Thread Mike Rapoport
additional call sites ] Signed-off-by: Christophe Leroy Signed-off-by: Mike Rapoport --- arch/powerpc/kernel/dt_cpu_ftrs.c | 3 +-- arch/powerpc/kernel/irq.c | 5 - arch/powerpc/kernel/paca.c| 6 +- arch/powerpc/kernel/prom.c| 5 - arch/powerpc/kernel/setup_32

[PATCH 03/21] memblock: replace memblock_alloc_base(ANYWHERE) with memblock_phys_alloc

2019-01-16 Thread Mike Rapoport
patch: @@ expression size, align; @@ - memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE) + memblock_phys_alloc(size, align) Signed-off-by: Mike Rapoport --- arch/arm/mm/init.c | 2 +- arch/sh/boards/mach-ap325rxa/setup.c | 2 +- arch/sh/boards/mach-ecovec24/setup.c | 4

[PATCH 13/21] arch: don't memset(0) memory returned by memblock_alloc()

2019-01-16 Thread Mike Rapoport
memblock_alloc() already clears the allocated memory, no point in doing it twice. Signed-off-by: Mike Rapoport --- arch/c6x/mm/init.c | 1 - arch/h8300/mm/init.c| 1 - arch/ia64/kernel/mca.c | 2 -- arch/m68k/mm/mcfmmu.c | 1 - arch/microblaze/mm/init.c | 6

[PATCH 11/21] memblock: make memblock_find_in_range_node() and choose_memblock_flags() static

2019-01-16 Thread Mike Rapoport
These functions are not used outside memblock. Make them static. Signed-off-by: Mike Rapoport --- include/linux/memblock.h | 4 mm/memblock.c| 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index

[PATCH 12/21] arch: use memblock_alloc() instead of memblock_alloc_from(size, align, 0)

2019-01-16 Thread Mike Rapoport
The last parameter of memblock_alloc_from() is the lower limit for the memory allocation. When it is 0, the call is equivalent to memblock_alloc(). Signed-off-by: Mike Rapoport --- arch/alpha/kernel/core_cia.c | 2 +- arch/alpha/kernel/pci_iommu.c | 4 ++-- arch/alpha/kernel/setup.c | 2

[PATCH 10/21] memblock: refactor internal allocation functions

2019-01-16 Thread Mike Rapoport
with exact requirement for lower bounds. The memblock_phys_alloc_nid() function is completely dropped as it is not used anywhere outside memblock and its only usage can be replaced by a call to memblock_alloc_range_nid(). Signed-off-by: Mike Rapoport --- include/linux/memblock.h | 1 - mm

[PATCH 06/21] memblock: memblock_phys_alloc_try_nid(): don't panic

2019-01-16 Thread Mike Rapoport
with the direct call to memblock_alloc_range_nid() and update the memblock_phys_alloc_try_nid() callers to check the returned value and panic in case of error. Signed-off-by: Mike Rapoport --- arch/arm64/mm/numa.c | 4 arch/powerpc/mm/numa.c | 4 mm/memblock.c | 4 +++- 3 files changed

[PATCH 07/21] memblock: memblock_phys_alloc(): don't panic

2019-01-16 Thread Mike Rapoport
Make the memblock_phys_alloc() function an inline wrapper for memblock_phys_alloc_range() and update the memblock_phys_alloc() callers to check the returned value and panic in case of error. Signed-off-by: Mike Rapoport --- arch/arm/mm/init.c | 4 arch/arm64/mm/mmu.c

[PATCH 15/21] sparc: add checks for the return value of memblock_alloc*()

2019-01-16 Thread Mike Rapoport
to accommodate the change. Signed-off-by: Mike Rapoport --- arch/sparc/kernel/prom_32.c | 2 ++ arch/sparc/kernel/setup_64.c | 6 ++ arch/sparc/kernel/smp_64.c | 12 arch/sparc/mm/init_64.c | 11 +++ arch/sparc/mm/srmmu.c| 8 5 files changed, 39

[PATCH 20/21] memblock: memblock_alloc_try_nid: don't panic

2019-01-16 Thread Mike Rapoport
As all the memblock_alloc*() users are now checking the return value and panic() in case of error, the panic() call can be removed from the core memblock allocator, namely memblock_alloc_try_nid(). Signed-off-by: Mike Rapoport --- mm/memblock.c | 15 +-- 1 file changed, 5 insertions

[PATCH 21/21] memblock: drop memblock_alloc_*_nopanic() variants

2019-01-16 Thread Mike Rapoport
As all the memblock allocation functions return NULL in case of error rather than panic(), the duplicates with _nopanic suffix can be removed. Signed-off-by: Mike Rapoport --- arch/arc/kernel/unwind.c | 3 +-- arch/sh/mm/init.c | 2 +- arch/x86/kernel/setup_percpu.c | 10

[PATCH 16/21] mm/percpu: add checks for the return value of memblock_alloc*()

2019-01-16 Thread Mike Rapoport
Add panic() calls if memblock_alloc() returns NULL. The panic() format duplicates the one used by memblock itself and in order to avoid explosion with long parameters list replace open coded allocation size calculations with a local variable. Signed-off-by: Mike Rapoport --- mm/percpu.c | 73

Re: [PATCH 19/21] treewide: add checks for the return value of memblock_alloc*()

2019-01-16 Thread Mike Rapoport
On Wed, Jan 16, 2019 at 03:27:35PM +0100, Geert Uytterhoeven wrote: > Hi Mike, > > On Wed, Jan 16, 2019 at 2:46 PM Mike Rapoport wrote: > > Add check for the return value of memblock_alloc*() functions and call > > panic() in case of error. > > The panic message repea

[PATCH v2 13/21] arch: don't memset(0) memory returned by memblock_alloc()

2019-01-21 Thread Mike Rapoport
memblock_alloc() already clears the allocated memory, no point in doing it twice. Signed-off-by: Mike Rapoport Acked-by: Geert Uytterhoeven # m68k --- arch/c6x/mm/init.c | 1 - arch/h8300/mm/init.c| 1 - arch/ia64/kernel/mca.c | 2 -- arch/m68k/mm/mcfmmu.c | 1

[PATCH v2 08/21] memblock: drop __memblock_alloc_base()

2019-01-21 Thread Mike Rapoport
The __memblock_alloc_base() function tries to allocate a memory up to the limit specified by its max_addr parameter. Depending on the value of this parameter, the __memblock_alloc_base() can is replaced with the appropriate memblock_phys_alloc*() variant. Signed-off-by: Mike Rapoport Acked

[PATCH v2 00/21] Refine memblock API

2019-01-21 Thread Mike Rapoport
memblock. v2 changes: * replace some more %lu with %zu * remove panics where they are not needed in s390 and in printk * collect Acked-by and Reviewed-by. Christophe Leroy (1): powerpc: use memblock functions returning virtual address Mike Rapoport (20): openrisc: prefer memblock APIs returning

[PATCH v2 03/21] memblock: replace memblock_alloc_base(ANYWHERE) with memblock_phys_alloc

2019-01-21 Thread Mike Rapoport
patch: @@ expression size, align; @@ - memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE) + memblock_phys_alloc(size, align) Signed-off-by: Mike Rapoport --- arch/arm/mm/init.c | 2 +- arch/sh/boards/mach-ap325rxa/setup.c | 2 +- arch/sh/boards/mach-ecovec24/setup.c | 4

[PATCH v2 04/21] memblock: drop memblock_alloc_base_nid()

2019-01-21 Thread Mike Rapoport
The memblock_alloc_base_nid() is a oneliner wrapper for memblock_alloc_range_nid() without any side effect. Replace it's usage by the direct calls to memblock_alloc_range_nid(). Signed-off-by: Mike Rapoport --- include/linux/memblock.h | 3 --- mm/memblock.c| 15 --- 2

[PATCH v2 02/21] powerpc: use memblock functions returning virtual address

2019-01-21 Thread Mike Rapoport
additional call sites ] Signed-off-by: Christophe Leroy Signed-off-by: Mike Rapoport --- arch/powerpc/kernel/dt_cpu_ftrs.c | 3 +-- arch/powerpc/kernel/irq.c | 5 - arch/powerpc/kernel/paca.c| 6 +- arch/powerpc/kernel/prom.c| 5 - arch/powerpc/kernel/setup_32

[PATCH v2 05/21] memblock: emphasize that memblock_alloc_range() returns a physical address

2019-01-21 Thread Mike Rapoport
. Signed-off-by: Mike Rapoport --- include/linux/memblock.h | 5 ++--- mm/cma.c | 10 -- mm/memblock.c| 9 + 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index f7ef313..66dfdb3 100644

[PATCH v2 17/21] init/main: add checks for the return value of memblock_alloc*()

2019-01-21 Thread Mike Rapoport
Add panic() calls if memblock_alloc() returns NULL. The panic() format duplicates the one used by memblock itself and in order to avoid explosion with long parameters list replace open coded allocation size calculations with a local variable. Signed-off-by: Mike Rapoport --- init/main.c | 26

[PATCH v2 09/21] memblock: drop memblock_alloc_base()

2019-01-21 Thread Mike Rapoport
The memblock_alloc_base() function tries to allocate a memory up to the limit specified by its max_addr parameter and panics if the allocation fails. Replace its usage with memblock_phys_alloc_range() and make the callers check the return value and panic in case of error. Signed-off-by: Mike

[PATCH v2 15/21] sparc: add checks for the return value of memblock_alloc*()

2019-01-21 Thread Mike Rapoport
to accommodate the change. Signed-off-by: Mike Rapoport Acked-by: David S. Miller --- arch/sparc/kernel/prom_32.c | 2 ++ arch/sparc/kernel/setup_64.c | 6 ++ arch/sparc/kernel/smp_64.c | 12 arch/sparc/mm/init_64.c | 11 +++ arch/sparc/mm/srmmu.c| 8 5

[PATCH v2 18/21] swiotlb: add checks for the return value of memblock_alloc*()

2019-01-21 Thread Mike Rapoport
Add panic() calls if memblock_alloc() returns NULL. The panic() format duplicates the one used by memblock itself and in order to avoid explosion with long parameters list replace open coded allocation size calculations with a local variable. Signed-off-by: Mike Rapoport --- kernel/dma

[PATCH v2 11/21] memblock: make memblock_find_in_range_node() and choose_memblock_flags() static

2019-01-21 Thread Mike Rapoport
These functions are not used outside memblock. Make them static. Signed-off-by: Mike Rapoport --- include/linux/memblock.h | 4 mm/memblock.c| 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index

[PATCH v2 19/21] treewide: add checks for the return value of memblock_alloc*()

2019-01-21 Thread Mike Rapoport
the one below with manual massaging of format strings. @@ expression ptr, size, align; @@ ptr = memblock_alloc(size, align); + if (!ptr) + panic("%s: Failed to allocate %lu bytes align=0x%lx\n", __func__, size, align); Signed-off-by: Mike Rapoport Reviewed-by: Guo Ren # c

[PATCH v2 21/21] memblock: drop memblock_alloc_*_nopanic() variants

2019-01-21 Thread Mike Rapoport
As all the memblock allocation functions return NULL in case of error rather than panic(), the duplicates with _nopanic suffix can be removed. Signed-off-by: Mike Rapoport Acked-by: Greg Kroah-Hartman --- arch/arc/kernel/unwind.c | 3 +-- arch/sh/mm/init.c | 2 +- arch/x86

[PATCH v2 14/21] ia64: add checks for the return value of memblock_alloc*()

2019-01-21 Thread Mike Rapoport
to accommodate the change. Signed-off-by: Mike Rapoport --- arch/ia64/kernel/mca.c | 20 ++-- arch/ia64/mm/contig.c | 8 ++-- arch/ia64/mm/discontig.c| 4 arch/ia64/mm/init.c | 38 ++ arch/ia64/mm

[PATCH v2 16/21] mm/percpu: add checks for the return value of memblock_alloc*()

2019-01-21 Thread Mike Rapoport
Add panic() calls if memblock_alloc() returns NULL. The panic() format duplicates the one used by memblock itself and in order to avoid explosion with long parameters list replace open coded allocation size calculations with a local variable. Signed-off-by: Mike Rapoport --- mm/percpu.c | 73

[PATCH v2 07/21] memblock: memblock_phys_alloc(): don't panic

2019-01-21 Thread Mike Rapoport
Make the memblock_phys_alloc() function an inline wrapper for memblock_phys_alloc_range() and update the memblock_phys_alloc() callers to check the returned value and panic in case of error. Signed-off-by: Mike Rapoport --- arch/arm/mm/init.c | 4 arch/arm64/mm/mmu.c

[PATCH v2 20/21] memblock: memblock_alloc_try_nid: don't panic

2019-01-21 Thread Mike Rapoport
As all the memblock_alloc*() users are now checking the return value and panic() in case of error, the panic() call can be removed from the core memblock allocator, namely memblock_alloc_try_nid(). Signed-off-by: Mike Rapoport --- mm/memblock.c | 15 +-- 1 file changed, 5 insertions

[PATCH v2 01/21] openrisc: prefer memblock APIs returning virtual address

2019-01-21 Thread Mike Rapoport
The allocation of the page tables memory in openrics uses memblock_phys_alloc() and then converts the returned physical address to virtual one. Use memblock_alloc_raw() and add a panic() if the allocation fails. Signed-off-by: Mike Rapoport --- arch/openrisc/mm/init.c | 5 - 1 file changed

[PATCH 06/30] memblock: rename memblock_alloc{_nid, _try_nid} to memblock_phys_alloc*

2018-09-14 Thread Mike Rapoport
: @@ expression e1, e2, e3; @@ ( - memblock_alloc(e1, e2) + memblock_phys_alloc(e1, e2) | - memblock_alloc_nid(e1, e2, e3) + memblock_phys_alloc_nid(e1, e2, e3) | - memblock_alloc_try_nid(e1, e2, e3) + memblock_phys_alloc_try_nid(e1, e2, e3) ) Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/arm

[PATCH 25/30] memblock: rename free_all_bootmem to memblock_free_all

2018-09-14 Thread Mike Rapoport
The conversion is done using sed -i 's@free_all_bootmem@memblock_free_all@' \ $(git grep -l free_all_bootmem) Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/alpha/mm/init.c | 2 +- arch/arc/mm/init.c | 2 +- arch/arm/mm/init.c

[PATCH 24/30] memblock: replace free_bootmem_late with memblock_free_late

2018-09-14 Thread Mike Rapoport
The free_bootmem_late and memblock_free_late do exactly the same thing: they iterate over a range and give pages to the page allocator. Replace calls to free_bootmem_late with calls to memblock_free_late and remove the bootmem variant. Signed-off-by: Mike Rapoport Acked-by: Michal Hocko

[PATCH 10/30] memblock: replace __alloc_bootmem_node_nopanic with memblock_alloc_try_nid_nopanic

2018-09-14 Thread Mike Rapoport
. Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/x86/kernel/setup_percpu.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index ea554f8..67d48e26 100644 --- a/arch/x86/kernel/setup_percpu.c

[PATCH 30/30] docs/boot-time-mm: remove bootmem documentation

2018-09-14 Thread Mike Rapoport
Signed-off-by: Mike Rapoport --- Documentation/core-api/boot-time-mm.rst | 71 + 1 file changed, 10 insertions(+), 61 deletions(-) diff --git a/Documentation/core-api/boot-time-mm.rst b/Documentation/core-api/boot-time-mm.rst index 03cb164..e5ec9f1 100644

[PATCH 04/30] mm: remove bootmem allocator implementation.

2018-09-14 Thread Mike Rapoport
All architectures have been converted to use MEMBLOCK + NO_BOOTMEM. The bootmem allocator implementation can be removed. Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- include/linux/bootmem.h | 16 - mm/bootmem.c| 811 2

[PATCH 19/30] memblock: replace alloc_bootmem_pages with memblock_alloc

2018-09-14 Thread Mike Rapoport
-by: Mike Rapoport Acked-by: Michal Hocko --- arch/c6x/mm/init.c | 3 ++- arch/h8300/mm/init.c | 2 +- arch/m68k/mm/init.c| 2 +- arch/m68k/mm/mcfmmu.c | 4 ++-- arch/m68k/mm/motorola.c| 2 +- arch/m68k/mm/sun3mmu.c | 4 ++-- arch/sh/mm

[PATCH 02/30] mm: remove CONFIG_NO_BOOTMEM

2018-09-14 Thread Mike Rapoport
All achitectures select NO_BOOTMEM which essentially becomes 'Y' for any kernel configuration and therefore it can be removed. Signed-off-by: Mike Rapoport --- arch/alpha/Kconfig | 1 - arch/arc/Kconfig| 1 - arch/arm/Kconfig| 1 - arch/arm64/Kconfig | 1 - arch

[PATCH 26/30] memblock: rename __free_pages_bootmem to memblock_free_pages

2018-09-14 Thread Mike Rapoport
The conversion is done using sed -i 's@__free_pages_bootmem@memblock_free_pages@' \ $(git grep -l __free_pages_bootmem) Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- mm/internal.h | 2 +- mm/memblock.c | 2 +- mm/nobootmem.c | 2 +- mm/page_alloc.c | 2 +- 4 files changed

[PATCH 05/30] mm: nobootmem: remove dead code

2018-09-14 Thread Mike Rapoport
Several bootmem functions and macros are not used. Remove them. Signed-off-by: Mike Rapoport --- include/linux/bootmem.h | 26 -- mm/nobootmem.c | 35 --- 2 files changed, 61 deletions(-) diff --git a/include/linux/bootmem.h b

[PATCH 03/30] mm: remove CONFIG_HAVE_MEMBLOCK

2018-09-14 Thread Mike Rapoport
All architecures use memblock for early memory management. There is no need for the CONFIG_HAVE_MEMBLOCK configuration option. Signed-off-by: Mike Rapoport --- arch/alpha/Kconfig | 1 - arch/arc/Kconfig| 1 - arch/arm/Kconfig| 1

[PATCH 01/30] mips: switch to NO_BOOTMEM

2018-09-14 Thread Mike Rapoport
allocations from the high memory. To have the exceptions base in the lower 512M of the physical memory, its allocation in arch/mips/kernel/traps.c::traps_init() is using bottom-up mode. Signed-off-by: Mike Rapoport --- arch/mips/Kconfig | 1 + arch/mips/kernel/setup.c

[PATCH 07/30] memblock: remove _virt from APIs returning virtual address

2018-09-14 Thread Mike Rapoport
The conversion is done using sed -i 's@memblock_virt_alloc@memblock_alloc@g' \ $(git grep -l memblock_virt_alloc) Signed-off-by: Mike Rapoport --- arch/arm/kernel/setup.c | 4 ++-- arch/arm/mach-omap2/omap_hwmod.c | 6 ++--- arch/arm64/mm/kasan_init.c

[PATCH 12/30] memblock: replace alloc_bootmem_low with memblock_alloc_low

2018-09-14 Thread Mike Rapoport
The alloc_bootmem_low(size) allocates low memory with default alignement and can be replcaed by memblock_alloc_low(size, 0) Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/arm64/kernel/setup.c | 2 +- arch/unicore32/kernel/setup.c | 2 +- 2 files changed, 2 insertions(+), 2

[PATCH 09/30] memblock: replace alloc_bootmem_low with memblock_alloc_low

2018-09-14 Thread Mike Rapoport
The functions are equivalent, just the later does not require nobootmem translation layer. Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/x86/kernel/tce_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/tce_64.c b/arch/x86/kernel/tce_64.c

[PATCH 08/30] memblock: replace alloc_bootmem_align with memblock_alloc

2018-09-14 Thread Mike Rapoport
The functions are equivalent, just the later does not require nobootmem translation layer. Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/x86/xen/p2m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index d6d74ef

[PATCH 11/30] memblock: replace alloc_bootmem_pages_nopanic with memblock_alloc_nopanic

2018-09-14 Thread Mike Rapoport
(size, PAGE_SIZE) also allocates PAGE_SIZE aligned memory without any restrictions and thus can be used as a replacement for alloc_bootmem_pages_nopanic() Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- drivers/usb/early/xhci-dbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 16/30] memblock: replace __alloc_bootmem_node with appropriate memblock_ API

2018-09-14 Thread Mike Rapoport
Use memblock_alloc_try_nid whenever goal (i.e. minimal address is specified) and memblock_alloc_node otherwise. Signed-off-by: Mike Rapoport --- arch/ia64/mm/discontig.c | 6 -- arch/powerpc/kernel/setup_64.c | 6 -- arch/sparc/kernel/setup_64.c | 10 -- arch/sparc

[PATCH 13/30] memblock: replace __alloc_bootmem_nopanic with memblock_alloc_from_nopanic

2018-09-14 Thread Mike Rapoport
for __alloc_bootmem_nopanic() is such cases. Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/arc/kernel/unwind.c | 4 ++-- arch/x86/kernel/setup_percpu.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arc/kernel/unwind.c b/arch/arc/kernel/unwind.c index 183391d

[PATCH 15/30] memblock: replace alloc_bootmem_pages_node with memblock_alloc_node

2018-09-14 Thread Mike Rapoport
The functions are equivalent, just the later does not require nobootmem translation layer. Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/ia64/mm/init.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index

[PATCH 17/30] memblock: replace alloc_bootmem_node with memblock_alloc_node

2018-09-14 Thread Mike Rapoport
Both functions attempt to allocate memory with specified alignment from a particular node. If the allocation from that node fails, they both fall back to allocating from any node in the system. Usage of native memblock API eliminates the nobootmem translation layer. Signed-off-by: Mike Rapoport

[PATCH 20/30] memblock: replace __alloc_bootmem with memblock_alloc_from

2018-09-14 Thread Mike Rapoport
The functions are equivalent, just the later does not require nobootmem translation layer. The conversion is done using the following semantic patch: @@ expression size, align, goal; @@ - __alloc_bootmem(size, align, goal) + memblock_alloc_from(size, align, goal) Signed-off-by: Mike Rapoport

[PATCH 18/30] memblock: replace alloc_bootmem_low_pages with memblock_alloc_low

2018-09-14 Thread Mike Rapoport
) + memblock_alloc_low(e, PAGE_SIZE) Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/arc/mm/highmem.c| 2 +- arch/m68k/atari/stram.c | 3 ++- arch/m68k/mm/motorola.c | 5 +++-- arch/mips/cavium-octeon/dma-octeon.c | 2 +- arch/mips/mm/init.c

[PATCH 14/30] memblock: add align parameter to memblock_alloc_node()

2018-09-14 Thread Mike Rapoport
With the align parameter memblock_alloc_node() can be used as drop in replacement for alloc_bootmem_pages_node() and __alloc_bootmem_node(), which is done in the following patches. Signed-off-by: Mike Rapoport --- include/linux/bootmem.h | 4 ++-- mm/sparse.c | 2 +- 2 files changed

[PATCH 29/30] mm: remove include/linux/bootmem.h

2018-09-14 Thread Mike Rapoport
-by: Mike Rapoport --- arch/alpha/kernel/core_cia.c| 2 +- arch/alpha/kernel/core_irongate.c | 1 - arch/alpha/kernel/core_marvel.c | 2 +- arch/alpha/kernel/core_titan.c | 2 +- arch/alpha/kernel/core_tsunami.c| 2 +- arch/alpha

[PATCH 22/30] mm: nobootmem: remove bootmem allocation APIs

2018-09-14 Thread Mike Rapoport
The bootmem compatibility APIs are not used and can be removed. Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- include/linux/bootmem.h | 47 -- mm/nobootmem.c | 224 2 files changed, 271 deletions(-) diff --git

[PATCH 21/30] memblock: replace alloc_bootmem with memblock_alloc

2018-09-14 Thread Mike Rapoport
the following semantic patch: @@ expression size; @@ - alloc_bootmem(size) + memblock_alloc(size, 0) Signed-off-by: Mike Rapoport --- arch/alpha/kernel/core_marvel.c | 4 ++-- arch/alpha/kernel/pci-noop.c| 4 ++-- arch/alpha/kernel/pci.c | 4 ++-- arch/alpha/kernel/pci_iommu.c

[PATCH 27/30] mm: remove nobootmem

2018-09-14 Thread Mike Rapoport
Move a few remaining functions from nobootmem.c to memblock.c and remove nobootmem Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- mm/Makefile| 1 - mm/memblock.c | 104 ++ mm/nobootmem.c | 128

[PATCH 28/30] memblock: replace BOOTMEM_ALLOC_* with MEMBLOCK variants

2018-09-14 Thread Mike Rapoport
Drop BOOTMEM_ALLOC_ACCESSIBLE and BOOTMEM_ALLOC_ANYWHERE in favor of identical MEMBLOCK definitions. Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/ia64/mm/discontig.c | 2 +- arch/powerpc/kernel/setup_64.c | 2 +- arch/sparc/kernel/smp_64.c | 2 +- arch/x86/kernel

[PATCH 23/30] memblock: replace free_bootmem{_node} with memblock_free

2018-09-14 Thread Mike Rapoport
) ) Signed-off-by: Mike Rapoport Acked-by: Michal Hocko --- arch/alpha/kernel/core_irongate.c | 3 +-- arch/arm64/mm/init.c | 2 +- arch/mips/kernel/setup.c | 2 +- arch/powerpc/kernel/setup_64.c| 2 +- arch/sparc/kernel/smp_64.c| 2 +- arch/um/kernel/mem.c

Re: [PATCH v2 06/21] memblock: memblock_phys_alloc_try_nid(): don't panic

2019-01-25 Thread Mike Rapoport
On Fri, Jan 25, 2019 at 05:45:02PM +, Catalin Marinas wrote: > On Mon, Jan 21, 2019 at 10:03:53AM +0200, Mike Rapoport wrote: > > diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c > > index ae34e3a..2c61ea4 100644 > > --- a/arch/arm64/mm/numa.c > >

Re: [PATCH v2 10/21] memblock: refactor internal allocation functions

2019-02-03 Thread Mike Rapoport
On Sun, Feb 03, 2019 at 08:39:20PM +1100, Michael Ellerman wrote: > Mike Rapoport writes: > > > Currently, memblock has several internal functions with overlapping > > functionality. They all call memblock_find_in_range_node() to find free > > memory and then reserve the

Re: [PATCH v2 19/21] treewide: add checks for the return value of memblock_alloc*()

2019-01-30 Thread Mike Rapoport
On Thu, Jan 31, 2019 at 08:07:29AM +0100, Christophe Leroy wrote: > > > Le 31/01/2019 à 07:44, Christophe Leroy a écrit : > > > > > >Le 31/01/2019 à 07:41, Mike Rapoport a écrit : > >>On Thu, Jan 31, 2019 at 07:07:46AM +0100, Christophe Leroy wrote: > >

Re: [PATCH v2 19/21] treewide: add checks for the return value of memblock_alloc*()

2019-01-30 Thread Mike Rapoport
On Thu, Jan 31, 2019 at 07:07:46AM +0100, Christophe Leroy wrote: > > > Le 21/01/2019 à 09:04, Mike Rapoport a écrit : > >Add check for the return value of memblock_alloc*() functions and call > >panic() in case of error. > >The panic message repeats the one used by p

[RFC/RFT WIP] arc: add sparsemem support

2019-05-26 Thread Mike Rapoport
and the memory can be populated at 0x8zz or 0x1zzz. -- Sincerely yours, Mike. Mike Rapoport (1): arc: add sparsemem support arch/arc/Kconfig | 9 + arch/arc/include/asm/sparsemem.h | 13 +++ arch/arc/mm/init.c | 84

[RFC/RFT WIP PATCH] arc: add sparsemem support

2019-05-26 Thread Mike Rapoport
the exact zone extents rather then their sizes. Signed-off-by: Mike Rapoport --- arch/arc/Kconfig | 9 + arch/arc/include/asm/sparsemem.h | 13 +++ arch/arc/mm/init.c | 84 include/linux/mm.h | 3 ++ mm

Re: [PATCH v2 00/21] Refine memblock API

2019-09-26 Thread Mike Rapoport
Hi, On Thu, Sep 26, 2019 at 08:09:52AM -0500, Adam Ford wrote: > On Wed, Sep 25, 2019 at 10:17 AM Fabio Estevam wrote: > > > > On Wed, Sep 25, 2019 at 9:17 AM Adam Ford wrote: > > > > > I tried cma=256M and noticed the cma dump at the beginning didn't > > > change. Do we need to setup a

Re: [PATCH V3 0/2] mm/debug: Add tests for architecture exported page table helpers

2019-09-24 Thread Mike Rapoport
On Tue, Sep 24, 2019 at 02:51:01PM +0300, Kirill A. Shutemov wrote: > On Fri, Sep 20, 2019 at 12:03:21PM +0530, Anshuman Khandual wrote: > > This series adds a test validation for architecture exported page table > > helpers. Patch in the series adds basic transformation tests at various > >

Re: [PATCH v2 00/21] Refine memblock API

2019-10-02 Thread Mike Rapoport
lock/reserved Thanks! >From 06529f861772b7dea2912fc2245debe4690139b8 Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Wed, 2 Oct 2019 10:14:17 +0300 Subject: [PATCH] mm: memblock: do not enforce current limit for memblock_phys* family Until commit 92d12f9544b7 ("memblock: refacto

Re: [PATCH v2 00/21] Refine memblock API

2019-09-28 Thread Mike Rapoport
On Thu, Sep 26, 2019 at 02:35:53PM -0500, Adam Ford wrote: > On Thu, Sep 26, 2019 at 11:04 AM Mike Rapoport wrote: > > > > Hi, > > > > On Thu, Sep 26, 2019 at 08:09:52AM -0500, Adam Ford wrote: > > > On Wed, Sep 25, 2019 at 10:17 AM Fabio Estevam wrote: >

[PATCH] ARC: mm: drop stale define of __ARCH_USE_5LEVEL_HACK

2019-12-09 Thread Mike Rapoport
From: Mike Rapoport Commit 6aae3425aa9c ("ARC: mm: remove __ARCH_USE_5LEVEL_HACK") make ARC paging code 5-level compliant but left behind a stale define of __ARCH_USE_5LEVEL_HACK in arch/arc/include/asm/hugepage.h. Remove it. Signed-off-by: Mike Rapoport --- arch/arc/include/asm/

Re: [PATCH v3] ARC: mm: remove __ARCH_USE_5LEVEL_HACK

2019-10-22 Thread Mike Rapoport
d new delta > | free_pgd_range 546 656+110 > | p4d_clear_bad 2 20 +18 > | Total: Before=4137148, After=4137276, chg 0.00% > > Cc: Kirill A. Shutemov > Signed-off-by: Vineet Gupta Acked-by: Mike Rapoport

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-29 Thread Mike Rapoport
On Wed, Jan 29, 2020 at 11:20:44PM +0100, Gerald Schaefer wrote: > On Mon, 27 Jan 2020 22:33:08 -0500 > > For example, who would have thought that pXd_bad() is supposed to > report large entries as bad? It's not really documented anywhere, A bit off-topic, @Anshuman, maybe you could start a

Re: [PATCH V12] mm/debug: Add tests validating architecture page table helpers

2020-01-28 Thread Mike Rapoport
Hello Qian, On Mon, Jan 27, 2020 at 10:33:08PM -0500, Qian Cai wrote: > > > On Jan 27, 2020, at 10:06 PM, Anshuman Khandual > > wrote: > > > > enablement of this test (for the moment) but then the goal is to integrate > > all > > of them going forward. The test not only validates platform's

[PATCH 13/21] unicore32: simplify detection of memory zone boundaries

2020-04-12 Thread Mike Rapoport
From: Mike Rapoport The free_area_init() function only requires the definition of maximal PFN for each of the supported zone rater than calculation of actual zone sizes and the sizes of the holes between the zones. After removal of CONFIG_HAVE_MEMBLOCK_NODE_MAP the free_area_init() is available

[PATCH 15/21] mm: memmap_init: iterate over memblock regions rather that check each PFN

2020-04-12 Thread Mike Rapoport
-by: Baoquan He Signed-off-by: Mike Rapoport --- mm/page_alloc.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 7f6a3081edb8..c43ce8709457 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5995,14

[PATCH 16/21] mm: remove early_pfn_in_nid() and CONFIG_NODES_SPAN_OTHER_NODES

2020-04-12 Thread Mike Rapoport
From: Mike Rapoport The commit f47ac088c406 ("mm: memmap_init: iterate over memblock regions rather that check each PFN") made early_pfn_in_nid() obsolete and since CONFIG_NODES_SPAN_OTHER_NODES is only used to pick a stub or a real implementation of early_pfn_in_nid() it is also

  1   2   3   4   >