From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 249BDC43334 for ; Thu, 6 Sep 2018 07:53:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA1C420652 for ; Thu, 6 Sep 2018 07:53:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA1C420652 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbeIFM1b (ORCPT ); Thu, 6 Sep 2018 08:27:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:60844 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725819AbeIFM1b (ORCPT ); Thu, 6 Sep 2018 08:27:31 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7D165ADF4; Thu, 6 Sep 2018 07:53:19 +0000 (UTC) Date: Thu, 6 Sep 2018 09:53:19 +0200 From: Michal Hocko To: Mike Rapoport Cc: linux-mm@kvack.org, Andrew Morton , "David S. Miller" , Greg Kroah-Hartman , Ingo Molnar , Michael Ellerman , Paul Burton , Thomas Gleixner , Tony Luck , linux-ia64@vger.kernel.org, linux-mips@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 11/29] memblock: replace alloc_bootmem_pages_nopanic with memblock_alloc_nopanic Message-ID: <20180906075319.GT14951@dhcp22.suse.cz> References: <1536163184-26356-1-git-send-email-rppt@linux.vnet.ibm.com> <1536163184-26356-12-git-send-email-rppt@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1536163184-26356-12-git-send-email-rppt@linux.vnet.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 05-09-18 18:59:26, Mike Rapoport wrote: > The alloc_bootmem_pages_nopanic(size) is a shortcut for > __alloc_bootmem_nopanic(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) and can be > replaced by memblock_alloc_nopanic(size, PAGE_SIZE) It is not so straightforward because you really have to go deep down the callpath to see they are doing the same thing essentially. > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > drivers/usb/early/xhci-dbc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c > index e15e896..16df968 100644 > --- a/drivers/usb/early/xhci-dbc.c > +++ b/drivers/usb/early/xhci-dbc.c > @@ -94,7 +94,7 @@ static void * __init xdbc_get_page(dma_addr_t *dma_addr) > { > void *virt; > > - virt = alloc_bootmem_pages_nopanic(PAGE_SIZE); > + virt = memblock_alloc_nopanic(PAGE_SIZE, PAGE_SIZE); > if (!virt) > return NULL; > > -- > 2.7.4 > -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Date: Thu, 06 Sep 2018 07:53:19 +0000 Subject: Re: [RFC PATCH 11/29] memblock: replace alloc_bootmem_pages_nopanic with memblock_alloc_nopanic Message-Id: <20180906075319.GT14951@dhcp22.suse.cz> List-Id: References: <1536163184-26356-1-git-send-email-rppt@linux.vnet.ibm.com> <1536163184-26356-12-git-send-email-rppt@linux.vnet.ibm.com> In-Reply-To: <1536163184-26356-12-git-send-email-rppt@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mike Rapoport Cc: linux-mm@kvack.org, Andrew Morton , "David S. Miller" , Greg Kroah-Hartman , Ingo Molnar , Michael Ellerman , Paul Burton , Thomas Gleixner , Tony Luck , linux-ia64@vger.kernel.org, linux-mips@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org On Wed 05-09-18 18:59:26, Mike Rapoport wrote: > The alloc_bootmem_pages_nopanic(size) is a shortcut for > __alloc_bootmem_nopanic(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT) and can be > replaced by memblock_alloc_nopanic(size, PAGE_SIZE) It is not so straightforward because you really have to go deep down the callpath to see they are doing the same thing essentially. > Signed-off-by: Mike Rapoport Acked-by: Michal Hocko > --- > drivers/usb/early/xhci-dbc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c > index e15e896..16df968 100644 > --- a/drivers/usb/early/xhci-dbc.c > +++ b/drivers/usb/early/xhci-dbc.c > @@ -94,7 +94,7 @@ static void * __init xdbc_get_page(dma_addr_t *dma_addr) > { > void *virt; > > - virt = alloc_bootmem_pages_nopanic(PAGE_SIZE); > + virt = memblock_alloc_nopanic(PAGE_SIZE, PAGE_SIZE); > if (!virt) > return NULL; > > -- > 2.7.4 > -- Michal Hocko SUSE Labs