Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3992368imm; Wed, 5 Sep 2018 09:02:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZNVbTXPdfWJHrKBQeMcvmTGvT6xW5H+AvOQdmYDP8sXpQTzgJId6cnvz64t6bztfmrfB2l X-Received: by 2002:a62:d44a:: with SMTP id u10-v6mr33492265pfl.144.1536163364765; Wed, 05 Sep 2018 09:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536163364; cv=none; d=google.com; s=arc-20160816; b=vtWlsTL4ztLNpu7Eq7hvnktwM6irDnuvtLkJKrYm2LiSgYGfhsUi56mbE9Uy0Jayxu EyYnS2Ln2Ar5faMrByLkdU8xpX4o2b4Lr7ZcqSpLBjcxfo9L0rLbgK4euX4I4Ie0VlGo s1+UNdsflS5Pab5bHfmxXVx4wi5sdnkeQUddIi+QMlb/hMJd/b1zXy1Jix+5Zzx04iFW TyDW2oPxvjIz3T9YbsMKVZe9vwWpq4blPrEkXRE1LSALYh431bZR/0semSvQiOdMRH9S 7nh7qoIq+oJhBACYOaT5XfFsCCvOpU+SDgcILLTbrJkH+DyljDnXprPFejWoiAiFZGhS Zarg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=O3HhXyIyLwtOvtBTggJXTDnAw3xgRvRvXHFqWKdUjgE=; b=Rz9kc4+BzVCc+eDpOvOtes8by5R4W0qgLwoxKiXDIxefsGnr6cPdNt+FgURUArv2Si s7eKbOXKqCUfh5lXvkG2Nj1da2PfuBtPG6azxRkdrO9bCHucB8uSx1gh1akc88NNJFFN 7FVu2Fn8DQTxrtF6i1gOKXPAV/II7fKoc1h8OYWSCm4hsTl9KSunewWzaL94J22Y1YR/ 7aahiFPbWsCWXlloXA8OHqy5/TyefajUmfP6M2HASCEy7oJ3DRMpya/PhqGWLEi+7bKm EcEumQJ2eQY5aaTbeTOXyGW0Kr3LXLOVNQOD4zoAyRFZLAuidSDY5tN2NFTJ/w2I0ZtH w4PQ== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j64-v6si2124320pgd.199.2018.09.05.09.02.28; Wed, 05 Sep 2018 09:02: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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728049AbeIEUbc (ORCPT + 99 others); Wed, 5 Sep 2018 16:31:32 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42390 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728014AbeIEUbc (ORCPT ); Wed, 5 Sep 2018 16:31:32 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w85FuicV083521 for ; Wed, 5 Sep 2018 12:00:42 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2maghme2uy-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 05 Sep 2018 12:00:41 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 5 Sep 2018 17:00:37 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 5 Sep 2018 17:00:33 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w85G0WcD43122784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 5 Sep 2018 16:00:32 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A64115205F; Wed, 5 Sep 2018 19:00:24 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.8.92]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id 8F8455204F; Wed, 5 Sep 2018 19:00:22 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Wed, 05 Sep 2018 19:00:29 +0300 From: Mike Rapoport To: linux-mm@kvack.org Cc: Andrew Morton , "David S. Miller" , Greg Kroah-Hartman , Ingo Molnar , Michael Ellerman , Michal Hocko , 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, Mike Rapoport Subject: [RFC PATCH 16/29] memblock: replace __alloc_bootmem_node with appropriate memblock_ API Date: Wed, 5 Sep 2018 18:59:31 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536163184-26356-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1536163184-26356-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18090516-0016-0000-0000-00000200C38E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18090516-0017-0000-0000-000032576838 Message-Id: <1536163184-26356-17-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-05_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809050164 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use memblock_alloc_try_nid whenever goal (i.e. mininal address is specified) and memblock_alloc_node otherwise. Signed-off-by: Mike Rapoport --- arch/ia64/mm/discontig.c | 6 ++++-- arch/ia64/mm/init.c | 2 +- arch/powerpc/kernel/setup_64.c | 6 ++++-- arch/sparc/kernel/setup_64.c | 10 ++++------ arch/sparc/kernel/smp_64.c | 4 ++-- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index 1928d57..918dda9 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c @@ -451,8 +451,10 @@ static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize) if (bestnode == -1) bestnode = anynode; - ptr = __alloc_bootmem_node(pgdat_list[bestnode], pernodesize, - PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); + ptr = memblock_alloc_try_nid(pernodesize, PERCPU_PAGE_SIZE, + __pa(MAX_DMA_ADDRESS), + BOOTMEM_ALLOC_ACCESSIBLE, + bestnode); return ptr; } diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index ffcc358..2169ca5 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -459,7 +459,7 @@ int __init create_mem_map_page_table(u64 start, u64 end, void *arg) pte = pte_offset_kernel(pmd, address); if (pte_none(*pte)) - set_pte(pte, pfn_pte(__pa(memblock_alloc_node(PAGE_SIZE, PAGE_SIZE, node))) >> PAGE_SHIFT, + set_pte(pte, pfn_pte(__pa(memblock_alloc_node(PAGE_SIZE, PAGE_SIZE, node)) >> PAGE_SHIFT, PAGE_KERNEL)); } return 0; diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 6a501b2..6add560 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -757,8 +757,10 @@ void __init emergency_stack_init(void) static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align) { - return __alloc_bootmem_node(NODE_DATA(early_cpu_to_node(cpu)), size, align, - __pa(MAX_DMA_ADDRESS)); + return memblock_alloc_try_nid(size, align, __pa(MAX_DMA_ADDRESS), + BOOTMEM_ALLOC_ACCESSIBLE, + early_cpu_to_node(cpu)); + } static void __init pcpu_fc_free(void *ptr, size_t size) diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index 206bf81..5fb11ea 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c @@ -622,12 +622,10 @@ void __init alloc_irqstack_bootmem(void) for_each_possible_cpu(i) { node = cpu_to_node(i); - softirq_stack[i] = __alloc_bootmem_node(NODE_DATA(node), - THREAD_SIZE, - THREAD_SIZE, 0); - hardirq_stack[i] = __alloc_bootmem_node(NODE_DATA(node), - THREAD_SIZE, - THREAD_SIZE, 0); + softirq_stack[i] = memblock_alloc_node(THREAD_SIZE, + THREAD_SIZE, node); + hardirq_stack[i] = memblock_alloc_node(THREAD_SIZE, + THREAD_SIZE, node); } } diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index d3ea1f3..83ff88d 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c @@ -1594,8 +1594,8 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, size_t size, pr_debug("per cpu data for cpu%d %lu bytes at %016lx\n", cpu, size, __pa(ptr)); } else { - ptr = __alloc_bootmem_node(NODE_DATA(node), - size, align, goal); + ptr = memblock_alloc_try_nid(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