Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp618788ybi; Fri, 12 Jul 2019 01:52:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7G34Wkqax0PlAUxW+bHAMQhA8YPTBi7KkK2HLp+Tkwl8+37HrtVcAiOBmNBZUULw1eBMX X-Received: by 2002:a17:902:e287:: with SMTP id cf7mr9958173plb.32.1562921576459; Fri, 12 Jul 2019 01:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562921576; cv=none; d=google.com; s=arc-20160816; b=C95kHvTSm3ULS0k7bw51UOaRCVlHZGBj52LNHEsIyBLqtouKp0mebUDAoCZJM7CGGB nMMc+5CaoKaz8a5gABg2JcO++e+jcsP5SuGOPbqIKpiaxJwvjDcNBeaIUDobFN4719/V bTVUbZVxfL0DEFFf7FbZRV6Bw2adFSKUwMPmKywK7fqOp7SJuSL963btWQRC7gfjPx+e BCYiiV90VXuzZLKF/CALL33qJsQ0qXfoMhwWyCUrX+k5QHcG2PY8lzp8IaX0AvhvKmeg egiKjwhy1+mYB58E626Vv0Wt9F0vgEa+djJ9SnD3GDiOaXcVrSCph2TcjuJ9/ZoxS7g/ Joxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=gIX56E206Ygtmlz0jOLcOvzHgmUrVjC3hqqjQDtHYu4=; b=e1PfoxGRqZjhxuSsoA0hB7ybFe1kLl+UtaO1ENseoxlAW623D0e17xI0ImRyjVbdnU ycK1R1yGKdw/+JJItMV/uXZE8zExbcfTUJ0ZEDDT1l563rB3z2nQCBpnYG50uct4PKpP 4hB92blSEASMvK+YeTpCvJsgkU53Sj7tJI4cy81VeAsN7A5t72Fm3DXUOacYlNXDS4ui Qy+Z7QuuILGp1OaPO2c7KPTr5SDksiJn0og2wTH7hLU2iYaiOyVPhfjYyVcytkNaAzi9 bLo+zK8cm4U2qIi5nvSQynuASUiFPhD1CAzB+fzWi4dofwu6SLUsyIW/9K4y6Tv+ZOrj wk0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=UR3LEgR9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e124si7113342pgc.115.2019.07.12.01.52.40; Fri, 12 Jul 2019 01:52:56 -0700 (PDT) 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=@amazon.de header.s=amazon201209 header.b=UR3LEgR9; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726351AbfGLIvq (ORCPT + 99 others); Fri, 12 Jul 2019 04:51:46 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:46518 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbfGLIvp (ORCPT ); Fri, 12 Jul 2019 04:51:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1562921504; x=1594457504; h=from:to:cc:subject:date:message-id; bh=gIX56E206Ygtmlz0jOLcOvzHgmUrVjC3hqqjQDtHYu4=; b=UR3LEgR9qvTWGJK4w2V/1+WTqanObJxl+AXKqhv/UTFNBj9dwl2aEtUQ mYmYFjEZYW6UlVa2xfR3uuFuviZy/w0dnTDJckC4JI5D/VU/5XBJmYCKC ncXqewPnym8CtD9FIqFJDBQLgNqK6Gd4OCbvD7ZT4axMplzkBfkPjsahe A=; X-IronPort-AV: E=Sophos;i="5.62,481,1554768000"; d="scan'208";a="685113937" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-2b-859fe132.us-west-2.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 12 Jul 2019 08:51:43 +0000 Received: from u54e1ad5160425a4b64ea.ant.amazon.com (pdx2-ws-svc-lb17-vlan3.amazon.com [10.247.140.70]) by email-inbound-relay-2b-859fe132.us-west-2.amazon.com (Postfix) with ESMTPS id 0FFBE222159; Fri, 12 Jul 2019 08:51:41 +0000 (UTC) Received: from u54e1ad5160425a4b64ea.ant.amazon.com (localhost [127.0.0.1]) by u54e1ad5160425a4b64ea.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTP id x6C8pb32024010; Fri, 12 Jul 2019 10:51:38 +0200 Received: (from karahmed@localhost) by u54e1ad5160425a4b64ea.ant.amazon.com (8.15.2/8.15.2/Submit) id x6C8pZ4Q024001; Fri, 12 Jul 2019 10:51:35 +0200 From: KarimAllah Ahmed To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: KarimAllah Ahmed , Andrew Morton , Pavel Tatashin , Oscar Salvador , Michal Hocko , Mike Rapoport , Baoquan He , Qian Cai , Wei Yang , Logan Gunthorpe Subject: [PATCH] mm: sparse: Skip no-map regions in memblocks_present Date: Fri, 12 Jul 2019 10:51:31 +0200 Message-Id: <1562921491-23899-1-git-send-email-karahmed@amazon.de> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not mark regions that are marked with nomap to be present, otherwise these memblock cause unnecessarily allocation of metadata. Cc: Andrew Morton Cc: Pavel Tatashin Cc: Oscar Salvador Cc: Michal Hocko Cc: Mike Rapoport Cc: Baoquan He Cc: Qian Cai Cc: Wei Yang Cc: Logan Gunthorpe Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: KarimAllah Ahmed --- mm/sparse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/sparse.c b/mm/sparse.c index fd13166..33810b6 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -256,6 +256,10 @@ void __init memblocks_present(void) struct memblock_region *reg; for_each_memblock(memory, reg) { + + if (memblock_is_nomap(reg)) + continue; + memory_present(memblock_get_region_node(reg), memblock_region_memory_base_pfn(reg), memblock_region_memory_end_pfn(reg)); -- 2.7.4