From patchwork Mon Oct 15 17:56:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 10642299 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 74FF6109C for ; Mon, 15 Oct 2018 17:57:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6837C2984E for ; Mon, 15 Oct 2018 17:57:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C61D298CA; Mon, 15 Oct 2018 17:57:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DDF72984E for ; Mon, 15 Oct 2018 17:57:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6AEBF6B0269; Mon, 15 Oct 2018 13:57:20 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 63BC46B026A; Mon, 15 Oct 2018 13:57:20 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C5196B026B; Mon, 15 Oct 2018 13:57:20 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-it1-f200.google.com (mail-it1-f200.google.com [209.85.166.200]) by kanga.kvack.org (Postfix) with ESMTP id 0BFC56B0269 for ; Mon, 15 Oct 2018 13:57:20 -0400 (EDT) Received: by mail-it1-f200.google.com with SMTP id z136-v6so23112104itc.5 for ; Mon, 15 Oct 2018 10:57:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :date:message-id:in-reply-to:references:mime-version :content-transfer-encoding:subject; bh=Pjn2SKMH8bI3Nc5MBoKr+9lA/vWqKzACQOBqjOPOq7Y=; b=mq4QtvYHSMhQdcMuVA2j3k3DUiWW7bfEBg/DlAVzixM4s/wsYwqvoOBgVgLzj6C1vb ZSxc5JZhKwplZNmh5l6EM8DUhMd8Z3vNk1ehw/W7KnEcpz4Se9kq5GVzH+Dl7LFbGgRQ k/AUfjfKTTfpmKmqfVvpgnSfXxu5ltzGKcVzM++m21w6jxsYbFpJmFwJ+SPxaXS7Mwgm nzSgD7vt4ZeFonIyBq/fNLOwa+cRwYJ3hYYncZ0FWBmfOFNEuK/cplgPOo7+2VchAIiI 4nMr6ewB5Fu4igVWpM92RciGMi2QGc+AyhnEewNr63qKOVpe6HbCd1kJSDQSf8RqKZFK sPfQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) smtp.mailfrom=gunthorp@deltatee.com X-Gm-Message-State: ABuFfohlfhAM14rYFKxs7zjyLAM/RuwpuYHAVuL+ry/sGSx2Uk10arvp Z6nsAvJF1k1AbqOYUTdk30/iggMBM9VgSkG/MxOsL2uMqdOc9B9EAYV7wFEVyRgiQTMdFjET6lI kAvS9zcTqs8i/B+d5ntDAK9C3lonYdP4KYEQRYgDX/4LdLv+ikAgO1cDHB9BbKyCOlw== X-Received: by 2002:a6b:d611:: with SMTP id w17-v6mr12393840ioa.216.1539626239777; Mon, 15 Oct 2018 10:57:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV61cU/yWM45ostcyCHhB5jXyaSmx7HAAr3H/S3Dv2dGADMlcrZ9CX6XXc3gcsmcrHUpOQ1ei X-Received: by 2002:a6b:d611:: with SMTP id w17-v6mr12393813ioa.216.1539626239135; Mon, 15 Oct 2018 10:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539626239; cv=none; d=google.com; s=arc-20160816; b=xiWU++L83liKz6SzN8PVV9zL0LLFU3Psue9xtAFmyj7L+xx7YK3KXCEzr9wHupKq1Z qJFxMlg2WgPIW2TmprkXuqzBorTRGgQLyjluVVdzm2XwhteiU6Q8FTCsN+c76oTe+xsf qjTYzKMZzFOzfmzItSPB+UdNqRbOlHWfsHNKC6+uGZw6VZxaMQqhLawFKo4rvGMkHSzB 0r9bLto4KqHssEWtWBCGl1C6kFZvTru3NPhOkEypAZSAI7hMTwZXyo14fRE72SXHI0M4 FNb9holmme7G93YeM5jdYi0Ztfz0uHX26HxayP3sI1C2qaBd/2PcJQkfJeteanTkkvXh VPLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:cc:to:from; bh=Pjn2SKMH8bI3Nc5MBoKr+9lA/vWqKzACQOBqjOPOq7Y=; b=tKYYLA0ZTWJ8UaAU7NUz3Xgi/201j2DVUerC9Qpw/IAyYD7dJeTRzf4oSecGhhe7mp SORFsoPqeWT26nOqdajAsEKqfcdoZHvTSY4l/zkwjXPgqcYoKZsKhinEjvu27GzEmau4 wYMr9axlFsXflZ6kORlCX+92DRDqqEdBUAbR60R8OjGByL9avajkiRNEcfHualGVt0Jg b8ftBR7JyjcCDamHECcubjIgNFzKPohfkD7iLqfsf57S/4BILRFTubnQmcs1Mo1NSjzT 02SOU3empZjky4DqrLFtTSuoXl341eFEHkd89l8SEG9qScyA2BZk18Lx9qVdwpdyq6Eb q1Zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) smtp.mailfrom=gunthorp@deltatee.com Received: from ale.deltatee.com (ale.deltatee.com. [207.54.116.67]) by mx.google.com with ESMTPS id t140-v6si8143869itf.139.2018.10.15.10.57.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Oct 2018 10:57:19 -0700 (PDT) Received-SPF: pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) client-ip=207.54.116.67; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gunthorp@deltatee.com designates 207.54.116.67 as permitted sender) smtp.mailfrom=gunthorp@deltatee.com Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gC77D-0002IK-Pi; Mon, 15 Oct 2018 11:57:18 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1gC779-0002Mg-AI; Mon, 15 Oct 2018 11:57:11 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org Cc: Stephen Bates , Palmer Dabbelt , Albert Ou , Christoph Hellwig , Andrew Morton , Arnd Bergmann , Logan Gunthorpe , Russell King , Kees Cook , Philip Derrin , "Steven Rostedt (VMware)" , Nicolas Pitre Date: Mon, 15 Oct 2018 11:56:59 -0600 Message-Id: <20181015175702.9036-4-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181015175702.9036-1-logang@deltatee.com> References: <20181015175702.9036-1-logang@deltatee.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, sbates@raithlin.com, palmer@sifive.com, aou@eecs.berkeley.edu, hch@lst.de, akpm@linux-foundation.org, arnd@arndb.de, logang@deltatee.com, linux@armlinux.org.uk, keescook@chromium.org, philip@cog.systems, rostedt@goodmis.org, nicolas.pitre@linaro.org X-SA-Exim-Mail-From: gunthorp@deltatee.com Subject: [PATCH v2 3/6] ARM: mm: make use of new memblocks_present() helper X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Cleanup the arm_memory_present() function seeing it's very similar to other arches. The new memblocks_present() helper checks for node ids which the arm version did not. However, this is equivalent seeing HAVE_MEMBLOCK_NODE_MAP should be false in this arch and therefore memblock_get_region_node() should return 0. Signed-off-by: Logan Gunthorpe Cc: Russell King Cc: Kees Cook Cc: Philip Derrin Cc: "Steven Rostedt (VMware)" Cc: Nicolas Pitre --- arch/arm/mm/init.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 0cc8e04295a4..e2710dd7446f 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -201,21 +201,6 @@ int pfn_valid(unsigned long pfn) EXPORT_SYMBOL(pfn_valid); #endif -#ifndef CONFIG_SPARSEMEM -static void __init arm_memory_present(void) -{ -} -#else -static void __init arm_memory_present(void) -{ - struct memblock_region *reg; - - for_each_memblock(memory, reg) - memory_present(0, memblock_region_memory_base_pfn(reg), - memblock_region_memory_end_pfn(reg)); -} -#endif - static bool arm_memblock_steal_permitted = true; phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align) @@ -317,7 +302,7 @@ void __init bootmem_init(void) * Sparsemem tries to allocate bootmem in memory_present(), * so must be done after the fixed reservations */ - arm_memory_present(); + memblocks_present(); /* * sparse_init() needs the bootmem allocator up and running.