From patchwork Fri Oct 5 16:16:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Logan Gunthorpe X-Patchwork-Id: 10628425 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 E25D7933 for ; Fri, 5 Oct 2018 16:17:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA71C29A12 for ; Fri, 5 Oct 2018 16:17:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC7DF29A2B; Fri, 5 Oct 2018 16:17:06 +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=ham 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 08C8629A12 for ; Fri, 5 Oct 2018 16:17:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2041D6B0269; Fri, 5 Oct 2018 12:16:52 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0EEA96B026A; Fri, 5 Oct 2018 12:16:52 -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 F1EF76B026B; Fri, 5 Oct 2018 12:16:51 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by kanga.kvack.org (Postfix) with ESMTP id C49886B0269 for ; Fri, 5 Oct 2018 12:16:51 -0400 (EDT) Received: by mail-io1-f71.google.com with SMTP id m7-v6so12616391iop.9 for ; Fri, 05 Oct 2018 09:16:51 -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=SPvFXHdiClQFO2SY0fkQCh1tDzoa6BIUR0siaeD0sS1R1q2ZZle2PLt4iwZwukuY9G ffkJG8tMjaLTZ2Rsv3ShH5u4k6/qmzzVcAmmzmxUFFQC3ke96Lm1SVcinUexkV+uk1rj AuzsyrfHfaadugpbTKdC6T04yb5jJFY2iFEEs1xHv6TXjl2P2GX7gSdmNfai34jAA2Yf LEJTWeEPs6bFPEQKZz8mDpoitpjjFl+kJURjxbb4LW4p47o98prUtztwlyeMIvyqNqNb hB5cyPh3lkGOCjGDujA5qHG+Cne2+vc3b1S8sxUuMSu+mJ/rs8IK0iwlhJoJR9B05fPS +W4A== 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: ABuFfogfXj9UfJ4GQdXdIhaRX+/XFRdElDPFj+6GnKMcytBbao794K0H b/bQJkenrVmnE5tbhaISuklbum0CeaQkyO/DuCpTIUi5xdin9D5aSpnBIq/GFFW/a60G/wbglsO hxdRfDLBHBTKfNkMwUhi915bmHFswY6O8HFiVI/7+Yrb+phYmeaWBWmYZBkRN34Przg== X-Received: by 2002:a6b:e00c:: with SMTP id z12-v6mr7759957iog.44.1538756211550; Fri, 05 Oct 2018 09:16:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV61zyrfT8MzXt8GmlPlRYtGmb+I83eRXLSXHMTeiWtbxvUvjirSKmJow94uJMrqXg/YpdG5q X-Received: by 2002:a6b:e00c:: with SMTP id z12-v6mr7759897iog.44.1538756210601; Fri, 05 Oct 2018 09:16:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538756210; cv=none; d=google.com; s=arc-20160816; b=suwuzxipu+mVFrA4Amd5f8YFUhMnJwgDSLdOO1ejQwwEyUavAvns5MTIK4O4ZeKJ3z jT+Pgacb/XXF2pQgJWfRjOLWj20D1YKW705b9e7iwj/oNM4EOd5ybarsJm4MxzIYP4kg kmJvM8vzSGrdXgzc46eius3ACWblfQ8he+lSxc3YgQhgSyFSbspXzhftePns2Td6Gg2k lcn2rBe4XIKMJDaBHzw4++9BDCTc8qUdv0nu4ueNLmufrnRtSvHNGuRuiw68TXnBlfnK VOPIGLo3q2Hovlx0n2F7XFn/QPPq5hynnoyTyetHcem+Iera09K4So6NW0HuNobWVa0q iIyQ== 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=iIAT1tJNTgA/Z/5xuAz/X9EzzVnGiCxuhawJgw5HpgY1/EOG896z5l2dOGWk1cs92/ oa9lnvBUpDDatzO+OzaYcLod8J+o1DZNSZiB8lUEwBTvSGkcFkdbUrvEMvqZgCAGjL8D 5ry4wfFFV+U7vqTiXnbKzIirVIky0VwIZaEWxPe+eeILHRwftnRrcFryrOgKJgWTniVu Qj6sEtbIIBit97e/wcT48gqW9+2Y2xHUzYaP3C3MIORcImIA4LWhNqlcYYy+0JoXc9c8 qTIEMYjYtEb4DIhES6B6Egxq0zVLjD3yyVlbzFeAyMmENTuE/+rEkMwjEV1Z0D3/I8Is qTOg== 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 c42-v6si5712919jaa.60.2018.10.05.09.16.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 09:16:50 -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 1g8SmU-0008D3-Sl; Fri, 05 Oct 2018 10:16:49 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.89) (envelope-from ) id 1g8SmS-0000ea-2I; Fri, 05 Oct 2018 10:16:44 -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 , Logan Gunthorpe , Russell King , Kees Cook , Philip Derrin , "Steven Rostedt (VMware)" , Nicolas Pitre Date: Fri, 5 Oct 2018 10:16:39 -0600 Message-Id: <20181005161642.2462-3-logang@deltatee.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181005161642.2462-1-logang@deltatee.com> References: <20181005161642.2462-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, 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 2/5] 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.