Re: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Mike Rapoport <rppt@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH 14/30] memblock: add align parameter to memblock_alloc_node()
- From: Michal Hocko <mhocko@xxxxxxxxxx>
- Date: Wed, 26 Sep 2018 11:31:27 +0200
- Cc: linux-mm@xxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Chris Zankel <chris@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Greentime Hu <green.hu@xxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Guan Xuetao <gxt@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, "James E.J. Bottomley" <jejb@xxxxxxxxxxxxxxxx>, Jonas Bonn <jonas@xxxxxxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, Ley Foon Tan <lftan@xxxxxxxxxx>, Mark Salter <msalter@xxxxxxxxxx>, Martin Schwidefsky <schwidefsky@xxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxx>, Paul Burton <paul.burton@xxxxxxxx>, Richard Kuo <rkuo@xxxxxxxxxxxxxx>, Richard Weinberger <richard@xxxxxx>, Rich Felker <dalias@xxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Serge Semin <fancer.lancer@xxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Vineet Gupta <vgupta@xxxxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, linux-alpha@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-c6x-dev@xxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, nios2-dev@xxxxxxxxxxxxxxxxxxxxxx, openrisc@xxxxxxxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, uclinux-h8-devel@xxxxxxxxxxxxxxxxxxxx
- In-reply-to: <1536927045-23536-15-git-send-email-rppt@linux.vnet.ibm.com>
- References: <1536927045-23536-1-git-send-email-rppt@linux.vnet.ibm.com> <1536927045-23536-15-git-send-email-rppt@linux.vnet.ibm.com>
- User-agent: Mutt/1.10.1 (2018-07-13)
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 for alloc_bootmem_pages_node() and __alloc_bootmem_node(),
> which is done in the following patches.
/me confused. Why do we need this patch at all? Maybe it should be
folded into the later patch you are refereing here?
> Signed-off-by: Mike Rapoport <rppt@xxxxxxxxxxxxxxxxxx>
> ---
> include/linux/bootmem.h | 4 ++--
> mm/sparse.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
> index 7d91f0f..3896af2 100644
> --- a/include/linux/bootmem.h
> +++ b/include/linux/bootmem.h
> @@ -157,9 +157,9 @@ static inline void * __init memblock_alloc_from_nopanic(
> }
>
> static inline void * __init memblock_alloc_node(
> - phys_addr_t size, int nid)
> + phys_addr_t size, phys_addr_t align, int nid)
> {
> - return memblock_alloc_try_nid(size, 0, BOOTMEM_LOW_LIMIT,
> + return memblock_alloc_try_nid(size, align, BOOTMEM_LOW_LIMIT,
> BOOTMEM_ALLOC_ACCESSIBLE, nid);
> }
>
> diff --git a/mm/sparse.c b/mm/sparse.c
> index 04e97af..509828f 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -68,7 +68,7 @@ static noinline struct mem_section __ref *sparse_index_alloc(int nid)
> if (slab_is_available())
> section = kzalloc_node(array_size, GFP_KERNEL, nid);
> else
> - section = memblock_alloc_node(array_size, nid);
> + section = memblock_alloc_node(array_size, 0, nid);
>
> return section;
> }
> --
> 2.7.4
>
--
Michal Hocko
SUSE Labs
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]