Received: by 10.223.148.5 with SMTP id 5csp6479934wrq; Wed, 17 Jan 2018 14:24:46 -0800 (PST) X-Google-Smtp-Source: ACJfBos1gl2qao8ldfgBV21YjEIgO12zv8cKtN9sOHGrvXncDOMT3M+SUeQl+mAaj2tQHMQQSIUw X-Received: by 10.98.17.21 with SMTP id z21mr15660003pfi.86.1516227886518; Wed, 17 Jan 2018 14:24:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516227886; cv=none; d=google.com; s=arc-20160816; b=u7tVfdVU6veNnp8qxlAnbIwsnSYqcYsbUScxRfAwO1Lw3wFEodaubgo1qUHX7UQOm+ AAQgDsCznX6x79Wf0VGN+fLaE9IcW1clQaa0ChpatQ+iyZcNdF8o5gZNCWEnV6N2GKlc 8je7uNs3KOChGZoqeZgkiY51Nl9nOVJV9K70tIlSQMkYIPNf4vBexrOaYYbBdCwh6E8g WsWkBwu9KznBcpWRypoVs25Do6+VhqVvNoDvcLrJuxg2yy85Rz2kmXaX/0haHE5UH8J4 eAtan9ILajFH3gghCNbtQsn/4QlXb0Cw8Wm+PLwtD2sJ8RX7LhVyhm+M7tTGIIv7tppR xxtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ALS7EM/i2r7JaIzzvHsmWtfz9QBCWCA+uD5osRYXYbA=; b=HzCKw91WiFpckEQX4IIKnf5y12L6NMeR9IoAidM1YK0AwtLyPSVPl9okXotwzeWpWr 3+IFsITfQMB1vGBtYdJM2Ddq/gR1Ubl3Dpnd49Chik9sdzJzUqFe6KDbTP12kFHv6zkx NmsE+zqWxNqeBIktKOBOCN74AaUxoQRlnENC2RKcb6n7VGhsGCBp93DII3xMYzGcUHAT xMV+8lbjeFKh0ztTeUey6mA2iZFiOD1TteWC5VpXaw8YJkNdgZvAaeGUnChI2x31BawT WcQjPmkwegb1IO64gCl+29Gw0BH9aYC1XAW9ImTxU7E3BzOxFAEKUFTbPCb+N6VznWQX A77A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=di4/eVOs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si4588770pga.22.2018.01.17.14.24.32; Wed, 17 Jan 2018 14:24:46 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=di4/eVOs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932158AbeAQWXj (ORCPT + 99 others); Wed, 17 Jan 2018 17:23:39 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:46522 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932103AbeAQWXg (ORCPT ); Wed, 17 Jan 2018 17:23:36 -0500 Received: by mail-lf0-f67.google.com with SMTP id q194so12528898lfe.13 for ; Wed, 17 Jan 2018 14:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ALS7EM/i2r7JaIzzvHsmWtfz9QBCWCA+uD5osRYXYbA=; b=di4/eVOs5HDzKL/Gh7SrnhOtbVlojP6DfYB6UJ1YAdPjrhO+tfcHZm/Y1WDbyiFBKv pRTmA3ciggum7Z68Ov09FzbV0arm7vRqmPR1778EILCXAyELiSV6hQJB1PwQDEBztfHO f5qSxiwJ+jF5VAVDeq6wwmdS3XKctCsfLsUNB3HnQ6w7IgrawO9jBtu54HeWHuEJY4hc GziFc6H4GlqpYwkpxzXaDCeD84QqTt/bgMVDaHe58lQcZmDvtcbym0bcJNDlNa9Zd+t8 3gyB3GkPL+aoA6NLn89XbAyavshTgwc/Q7cNCScFHHv2U7vk8liSiOg/3SjIgCAz4b2Y 4EoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ALS7EM/i2r7JaIzzvHsmWtfz9QBCWCA+uD5osRYXYbA=; b=rX5hsmQIMGhO+l33ir1ReG2B7pufpMuh9+l9yMDT0GF6r+5SSOIOIQy/uN7AdOE4gO mNqi7NazkLlYoEW5dppDMNjvwgQ+9+YiJnxsGu1ydkHjaPOrXCAM4mdip3z6jGR8/cz8 DWZqypLwFUMlrYw4/HGAhfIAilHcjGUlzc19Da+g2ISoTYhB5NsybZT4s2VLABgd0DOp Jg26LdKHveLxwQqqvfpa98OtRdZ+esfmaio/ZuKRy5neEUrXMg8B6NgGtr0q041qgBxV hbHTCKChSIgJ1Ved7XbvaCtmNHeGodRVyDBcjWgU99AOsGgEX+vSHJuaxkzBVDx1A27x oOag== X-Gm-Message-State: AKGB3mI5taAiTmWWoFIsgW2AMrdOVZCDAdrQBWiYZmeVx2/K/beHbsuP o/GgfrXKSiXTH5pDvcyrpz4= X-Received: by 10.46.84.9 with SMTP id i9mr25437922ljb.83.1516227815461; Wed, 17 Jan 2018 14:23:35 -0800 (PST) Received: from linux.local ([95.79.164.146]) by smtp.gmail.com with ESMTPSA id l203sm953867lfb.59.2018.01.17.14.23.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Jan 2018 14:23:34 -0800 (PST) From: Serge Semin To: ralf@linux-mips.org, miodrag.dinic@mips.com, jhogan@kernel.org, goran.ferenc@mips.com, david.daney@cavium.com, paul.gortmaker@windriver.com, paul.burton@mips.com, alex.belits@cavium.com, Steven.Hill@cavium.com Cc: alexander.sverdlin@nokia.com, matt.redfearn@mips.com, kumba@gentoo.org, marcin.nowakowski@mips.com, James.hogan@mips.com, Peter.Wotton@mips.com, Sergey.Semin@t-platforms.ru, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Serge Semin Subject: [PATCH 12/14] MIPS: memblock: Discard bootmem from Loongson3 code Date: Thu, 18 Jan 2018 01:23:10 +0300 Message-Id: <20180117222312.14763-13-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180117222312.14763-1-fancer.lancer@gmail.com> References: <20180117222312.14763-1-fancer.lancer@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 282c5a8c2..902843516 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); -- 2.12.0