Received: by 10.223.185.116 with SMTP id b49csp3689636wrg; Tue, 13 Feb 2018 06:19:16 -0800 (PST) X-Google-Smtp-Source: AH8x225DmnsxrArxwthXIkbmhPcNbuGlQr875ObmL4T1sU1QaT7aURhCT38mjUyTO9F7M1zpKO9l X-Received: by 2002:a17:902:8487:: with SMTP id c7-v6mr1246605plo.7.1518531556131; Tue, 13 Feb 2018 06:19:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518531556; cv=none; d=google.com; s=arc-20160816; b=tcf8UqxkJG88ohzsLWmK8mnxT4dUJzelhrFRbI8t0UCfpHTbMNHsladmG/2wP12+yb RFEMC0Zo/PPIa61ftVcq+1MhY2IElDbWCPN+I9w4A/W6AhpOjDa3DfH14r7i0JmEPPUq BKAtyIuLVv1RU4anuv78gtSLxsg1/gwHHlZdCk6cYxO6RVOEcSqcMpUyJqJFwYwZf+Z5 c7WO9QnJSBpKIG6xRrrbnw9rRO9lo4bplpTIXRPZg2pALb/DCoWfFXiUy8iEzTV+jw2n mt82UAlFU2EDDLKehFUbEwk66vSR0GR8H86osLIBS0TRp8FA5S3FMybeUoJOOv2PWGPH VjyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=TN/7F2Yt9Akf3VtLBC45XR1sc0oJubjGsc5UyQdsB7s=; b=zJFKCac4X8uxAEz0P+7rJbIeOwJkCSds0oCnFkV7pKNHQDlR9+9mUgRjMLwNIYabe9 J1xgePY9qsMg0o2n7OZvh4eBvvP47AXTDCIue9qKRRzLPLNX+hGSHwAai0AVIhVosp67 nqgVl+Kk4I89QmCTlia2s+gRSmldPufACN+s6RY0dH3Gb3GZLvg5wMDbnl5K76gV6sCz AAM69HbnHOqWLJmzQQzpqma8IAKsFg2IM7IMPYy6SBgExl5Q+7g7H4affP5S0StNm620 65IJksPKRYDpU8ChSettH0bMC/2i9jbryvw0l5WQ4+GBFMY9dQYajO1BXgXZT/qbcoEV L++Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 101-v6si2278129ple.263.2018.02.13.06.19.01; Tue, 13 Feb 2018 06:19:16 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965116AbeBMOSX (ORCPT + 99 others); Tue, 13 Feb 2018 09:18:23 -0500 Received: from 9pmail.ess.barracuda.com ([64.235.150.225]:42663 "EHLO 9pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964950AbeBMOSV (ORCPT ); Tue, 13 Feb 2018 09:18:21 -0500 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx1.ess.sfj.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Tue, 13 Feb 2018 14:14:51 +0000 Received: from [10.150.130.83] (10.150.130.83) by MIPSMAIL01.mipstec.com (10.20.43.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 13 Feb 2018 06:09:29 -0800 Subject: Re: [PATCH v2 13/15] MIPS: memblock: Discard bootmem from Loongson3 code To: Serge Semin , , , , , , , , , CC: , , , , , , , References: <20180117222312.14763-1-fancer.lancer@gmail.com> <20180202035458.30456-1-fancer.lancer@gmail.com> <20180202035458.30456-14-fancer.lancer@gmail.com> From: Matt Redfearn Message-ID: <65660251-bc25-c676-b08c-5168885faf5d@mips.com> Date: Tue, 13 Feb 2018 14:09:24 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180202035458.30456-14-fancer.lancer@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.150.130.83] X-BESS-ID: 1518531291-298552-26922-43867-3 X-BESS-VER: 2018.1-r1801291959 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.189978 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Serge, On 02/02/18 03:54, Serge Semin wrote: > Loongson64/3 runs its own code to initialize memory allocator in > case of NUMA configuration is selected. So in order to move to the > pure memblock utilization we discard the bootmem allocator usage > and insert the memblock reservation method for kernel/addrspace_offset > memory regions. > I don't have a NUMA Loongson to test with, but on a non-NUMA Loongson3 machine, tested as a part of the whole series, this works and looks good to me. Reviewed-by: Matt Redfearn Thanks, Matt > Signed-off-by: Serge Semin > --- > arch/mips/loongson64/loongson-3/numa.c | 16 +++++----------- > 1 file changed, 5 insertions(+), 11 deletions(-) > > diff --git a/arch/mips/loongson64/loongson-3/numa.c b/arch/mips/loongson64/loongson-3/numa.c > index f17ef520799a..2f1ebf496c17 100644 > --- a/arch/mips/loongson64/loongson-3/numa.c > +++ b/arch/mips/loongson64/loongson-3/numa.c > @@ -180,7 +180,6 @@ static void __init szmem(unsigned int node) > > static void __init node_mem_init(unsigned int node) > { > - unsigned long bootmap_size; > unsigned long node_addrspace_offset; > unsigned long start_pfn, end_pfn, freepfn; > > @@ -197,26 +196,21 @@ static void __init node_mem_init(unsigned int node) > > __node_data[node] = prealloc__node_data + node; > > - NODE_DATA(node)->bdata = &bootmem_node_data[node]; > NODE_DATA(node)->node_start_pfn = start_pfn; > NODE_DATA(node)->node_spanned_pages = end_pfn - start_pfn; > > - bootmap_size = init_bootmem_node(NODE_DATA(node), freepfn, > - start_pfn, end_pfn); > free_bootmem_with_active_regions(node, end_pfn); > if (node == 0) /* used by finalize_initrd() */ > max_low_pfn = end_pfn; > > - /* This is reserved for the kernel and bdata->node_bootmem_map */ > - reserve_bootmem_node(NODE_DATA(node), start_pfn << PAGE_SHIFT, > - ((freepfn - start_pfn) << PAGE_SHIFT) + bootmap_size, > - BOOTMEM_DEFAULT); > + /* This is reserved for the kernel only */ > + if (node == 0) > + memblock_reserve(start_pfn << PAGE_SHIFT, > + ((freepfn - start_pfn) << PAGE_SHIFT)); > > if (node == 0 && node_end_pfn(0) >= (0xffffffff >> PAGE_SHIFT)) { > /* Reserve 0xfe000000~0xffffffff for RS780E integrated GPU */ > - reserve_bootmem_node(NODE_DATA(node), > - (node_addrspace_offset | 0xfe000000), > - 32 << 20, BOOTMEM_DEFAULT); > + memblock_reserve(node_addrspace_offset | 0xfe000000, 32 << 20); > } > > sparse_memory_present_with_active_regions(node); >