Received: by 10.223.176.5 with SMTP id f5csp263762wra; Thu, 1 Feb 2018 19:58:19 -0800 (PST) X-Google-Smtp-Source: AH8x225DGbhqF6IKWq0gr8uleyasM/8ZnH8xLxl6DTBXqL0y2TFEM35Iw734z+xlewCgjtfcpMwG X-Received: by 2002:a17:902:2702:: with SMTP id c2-v6mr31933886plb.342.1517543899000; Thu, 01 Feb 2018 19:58:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517543898; cv=none; d=google.com; s=arc-20160816; b=pWHTm9UY2iHHmhcRmV0UIklfbny0DTINYxliTd7nTHrag20oEGiKAzvP1cvHGOkxLr NVtVgcbvqrlgo1pMvNhric3YzAVf4gg3zyWiDuFUbOaWoNCBGHVU/oJTlVNHPHY/SdIC kfAmGMeGXUt/WawYfX7BpKCJbdfR9uFtQGQEoEqRtt49hnWg4Xs/dZMhjlzDl9NlPfJO yiIMhZildPOADQnupk1aYKbiEFrSpTyc5usBnTfxhMac1uxilrx/wR48qYoM8e0HVUCn z3WwcTKDc0/6l1FL9lSbfbJcQVIB7l++Xcq0z9p6AFNpCEA8RUka0IGMTu9+35+ZYcZn QACQ== 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=fg4BuVQq5kDDzYpkoYvsMHx+BQH7P8vav3a6IimGF/s=; b=gqjvBuvW9uBHGynkkieAVNc32pqY7tAvXrrS+vo3TxwZ6AlbnO9DRBZBFgJd4BYvKv whJLqZ1B/UOivHRNEblnWaUJP6EiPEur4lrRFFvVYoTEssUzIffHuZ7rG3pYz55xbZ7r vMyaHH3KKjF4iUh8njrzZjTmXzR1WDBcwdDGs1dASPCvvayGPBX0dZsbP590pfzNCd1+ WSDugcVjyrjDUYSYqyzz4ZiqVUudSiJAB8rEoALctkL7UYYtnaBsYOUeNZyn0NgLhnlR yLqCXifKjZlSlXunR59ChWkhpzwDjXzMWZeVna7fzsDdFKg9iUm7Qrmx2q4DowyBD1WR ZJIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JHIWdNRO; 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 c11-v6si944823pls.801.2018.02.01.19.58.04; Thu, 01 Feb 2018 19:58:18 -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=JHIWdNRO; 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 S1751718AbeBBD4p (ORCPT + 99 others); Thu, 1 Feb 2018 22:56:45 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:33103 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869AbeBBDzV (ORCPT ); Thu, 1 Feb 2018 22:55:21 -0500 Received: by mail-lf0-f68.google.com with SMTP id t139so29463753lff.0 for ; Thu, 01 Feb 2018 19:55:21 -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=fg4BuVQq5kDDzYpkoYvsMHx+BQH7P8vav3a6IimGF/s=; b=JHIWdNRO+nh93eKi3qFW8lPssnm2TZ67czNeHF1joLWyTYxYxVJ1Z/9EGhdwl43Wdf wmSAIIdrpfxLUZH3nRltnCR4JUwORKayfPjYw5Z2xeg9YDiUJ5RWQwR9n/h1vckL7YkH N+pd52T2AiNI1fbd5414gKIiNu1B++r3K3iI54ZhFCT3czsqZbi8wouCTLOHHvW9dtfx +fg3z/21d5eE52xi1os95rvyyNq4d4vTKcJvrbRvZd5J47yG/fD5gH8iVVYFLzE1hxGv JLgxaNvXPcyyTtZE/5HLeJLPRl1fIXXUr3gXRGEYLtj5kovFwGeWzhvTZBkqWaXQZbbc sIBA== 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=fg4BuVQq5kDDzYpkoYvsMHx+BQH7P8vav3a6IimGF/s=; b=h4Odgib9u8YpSk8rLHskL9TVYQ0DFRJmZy/5gIZcMb1fggXlDX6dhSojBfTKlOJW0b isZxopRQFAPx5Vz3NMTdiKZP74Ve/RqKRSr0zTuaJ/TVssKm/2Ee2Sj2RwvMegs3q8Qm apwvY6U7Vhpg8YEs8fEjb2gb7X2jbBx2+F7NNZc/3lL03g2FVoUd3N/WUb+r/ni8DiXU 2wNYShx4BcsIqA+vzhywDYuwaYcrNF8rK3jPuGF4cVKcF0EXRgcfx4PyN9Bp2lcYwXov oQy0jtBaUeWe6MSsQlvlP65dmjCyDH+U0aI7ryMq+JFLcozlWNB2rqt6iZV0gS6ksMG3 RjkQ== X-Gm-Message-State: AKwxytf1fJTuWxn4g+ZHIuq4UxwxOixk018mDO+a6XN70PgnEpub0T5a sQGSdJaqL7vc/P6NvQxwBFw= X-Received: by 10.46.68.221 with SMTP id b90mr20603842ljf.62.1517543720554; Thu, 01 Feb 2018 19:55:20 -0800 (PST) Received: from linux.local ([95.79.164.146]) by smtp.gmail.com with ESMTPSA id f14sm190934lje.84.2018.02.01.19.55.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Feb 2018 19:55:19 -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 v2 13/15] MIPS: memblock: Discard bootmem from Loongson3 code Date: Fri, 2 Feb 2018 06:54:56 +0300 Message-Id: <20180202035458.30456-14-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180202035458.30456-1-fancer.lancer@gmail.com> References: <20180117222312.14763-1-fancer.lancer@gmail.com> <20180202035458.30456-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 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); -- 2.12.0