Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp209407imm; Thu, 6 Sep 2018 00:50:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ8wGYi6bGmPSqEyT2phJIVLTOGLJDOwf7aY2krTEBSVdlFxjzeuuesU2WLQTJj4oGcOZDo X-Received: by 2002:a63:8f17:: with SMTP id n23-v6mr1501197pgd.131.1536220244281; Thu, 06 Sep 2018 00:50:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536220244; cv=none; d=google.com; s=arc-20160816; b=lDVL/8oORo1K7SEBbX0g9eEZMNDsEe3CP/bPXTkoE7UPUhTVh0iCLaIRJGkqibf1bZ 612ZocB+ethCK5/2YB8p4ekx/oRU7wY5t/OPlItEmebP/dfUly0EsrMxm0thINRAaGHe D6pFRHpTsKe60CfdASU7Q4Unozj0MLHXfd4cnFMDBNWpWacAeBck3jxKonHqs5IIv0ck nHvhPx66FSkQ4fjkg0B5LJRRnWRa7ac/bRAVfHPYlXoJsGnfBblnrFNCFcgxKTXyZIbB fLGHhsgu4yl5XziZb1DlaJBOkvPyWnNkRH1zfqcqish0/g2XaCMNHN7MOyQMw7m8zrd5 rQZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ZTzFwo+tFx5pGv3KtIS/DA1xu24JmxYng6PmcQGYPUQ=; b=IT6Jzvsh5gfogIfCpp52LJZZ96uhqtem5d+kW+TSJIQHGomZ1A0t87iaW3et1buaTE 773jstM4O/itS5TDcf1WcK7kz5varvkeuq9dtYuYhPib99tfduOHp+3NgSL76c2EPykR Sp06AlALVJp9sXTuLJ6HuLPgsbg8p/Gmlp2gfxj8zz7luAKKcAjef3KP4MBaTW4AI8YZ 5FBkNFiUZ++zGz1ZVCld7HNsmadzxTpvhQtPVr5Qqm5EWa5fP0Oawec7SyguEA9pFlgV i0FF/oAHfftB6+q1i4M8cSeyATs2hbSrUwMe54aBd55VUlzIAC/MvU6VnGkZRez5nBpS kwlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12-v6si4319804pll.416.2018.09.06.00.50.28; Thu, 06 Sep 2018 00:50:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727885AbeIFMXd (ORCPT + 99 others); Thu, 6 Sep 2018 08:23:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:60526 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726490AbeIFMXc (ORCPT ); Thu, 6 Sep 2018 08:23:32 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 83F29ADF4; Thu, 6 Sep 2018 07:49:21 +0000 (UTC) Date: Thu, 6 Sep 2018 09:49: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 10/29] memblock: replace __alloc_bootmem_node_nopanic with memblock_alloc_try_nid_nopanic Message-ID: <20180906074919.GS14951@dhcp22.suse.cz> References: <1536163184-26356-1-git-send-email-rppt@linux.vnet.ibm.com> <1536163184-26356-11-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-11-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:25, Mike Rapoport wrote: > The __alloc_bootmem_node_nopanic() is used only once, there is no reason to > add a wrapper for memblock_alloc_try_nid_nopanic for it. OK, it took me a bit longer to see they are equivalent. Both zero the memory and fallback to a different node if the given one doesn't have a proper range. So good. Lack of proper documentation didn't really help. > 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 > +++ b/arch/x86/kernel/setup_percpu.c > @@ -112,8 +112,10 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size, > pr_debug("per cpu data for cpu%d %lu bytes at %016lx\n", > cpu, size, __pa(ptr)); > } else { > - ptr = __alloc_bootmem_node_nopanic(NODE_DATA(node), > - size, align, goal); > + ptr = memblock_alloc_try_nid_nopanic(size, align, goal, > + BOOTMEM_ALLOC_ACCESSIBLE, > + node); > + > pr_debug("per cpu data for cpu%d %lu bytes on node%d at %016lx\n", > cpu, size, node, __pa(ptr)); > } > -- > 2.7.4 -- Michal Hocko SUSE Labs