From patchwork Fri Jul 12 08:51:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KarimAllah Ahmed X-Patchwork-Id: 11041887 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 B9F691395 for ; Fri, 12 Jul 2019 08:51:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A853928B93 for ; Fri, 12 Jul 2019 08:51:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BC9128BA0; Fri, 12 Jul 2019 08:51:49 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 AC0C028B93 for ; Fri, 12 Jul 2019 08:51:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CE968E012A; Fri, 12 Jul 2019 04:51:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7A5708E00DB; Fri, 12 Jul 2019 04:51:46 -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 6BB798E012A; Fri, 12 Jul 2019 04:51:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by kanga.kvack.org (Postfix) with ESMTP id 4F2808E00DB for ; Fri, 12 Jul 2019 04:51:46 -0400 (EDT) Received: by mail-qt1-f198.google.com with SMTP id l9so6358893qtu.12 for ; Fri, 12 Jul 2019 01:51:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id; bh=gIX56E206Ygtmlz0jOLcOvzHgmUrVjC3hqqjQDtHYu4=; b=onXQXQXvVc+aa7Fn+6zi8kIKssvFO4px40usASvU4dtk8iAFFHxEbUNr8EqHdOl9SY wvwFCNDNCrngiXvumDmNSo4I1di3G2y5AKcjp14pCgLZquKUSuNykQJ9OKBDlTfBf8ZE eBVrkE9ePwaydgkfqNTaO1vlOuhlyCKa3dv+fCsa40CRCAzHMipUJ3NTxDOMinlaZYtB Rdv72DfNaTpv5RvvpGVeEiglAALdp3sbsbr9vOrOxCnQj1iJHGrzYQuHcggQWXHPPyGt y16nA74XfsPD5Y2xGKVqfBXV+SkW4P2nr0MHzyOux2IlwVxl6NxL5u3bOFgU6wPQMdo0 xtQg== X-Gm-Message-State: APjAAAV12MtYHSQGQkCisbgf5uwP2PF8k4wQe4aKrPVMx0z53mA1M1aw H5Nc4MX7bX/EN78MXpFoa5YvgntzH7sZ9poK6CK+TRcogUmcgkMJA/IKckUPZCHVuJMB2dhHysN U3/WeO5NMIfEvKsXFzMJOH0zrEqwmNHEZnX4dh/rR0UVZ7ImFy3IoIoS0LDvWrwRD5Q== X-Received: by 2002:ac8:7404:: with SMTP id p4mr5431387qtq.181.1562921506081; Fri, 12 Jul 2019 01:51:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLpnPU7tG+I2Qfa+zViE6a8RdYEVo0KYQvUSFcU8UsA1XCeSvzoluVYdUC06zpjR2SSBAf X-Received: by 2002:ac8:7404:: with SMTP id p4mr5431374qtq.181.1562921505609; Fri, 12 Jul 2019 01:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562921505; cv=none; d=google.com; s=arc-20160816; b=wrxnZbTmdCLmeNO1rJPwHfT1CR2Ihf8TJsJszdHb3XvltOv3Hkiqo9LUuUKnK9Xu4i pYTaBjfv7jBh8nWEOPzHLpS5dHvbCGVWvImsUoQ5KQTFEHAYBfAQZwIJGlfLSIWaWwDL KQy4681ODi64FFfvy8c8QuYXvhwIJdaMns39bq/KzwBxwiSCKKb2B5nP6BFyuvHBsVhO zUFHPkXWxPpAcenFftTC+9bLih/UHpk3iTJJSpIvTjSUeAEM0sCUCltJUddmjAtOYC2H Cr01uA2u+mPSu0+oCV5ofYiNQLjzbTzStI6OhUAwyh9HAOMtbzu2oaaOIykgnduvkFRj dTig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=gIX56E206Ygtmlz0jOLcOvzHgmUrVjC3hqqjQDtHYu4=; b=LePjsSnw88w/REuX8MNy6uc7AVcRRkhWO68PxOCMAU+Pt4hi6Q1MWf2swksusQGXTN yd4pHo3uDvGuDZpAkz8YitsLWXb5T5NQg1BYJh3yhRU9t0SpMSTv2eFo6M0kSAypWImm WSPDWE8R15POKtUFg0Dp/wBn9DoBhK0A+Pc1banuvOoMI6uRVQ1XQc+SEa4GVpqFtzJG mnMm2pC0ZNGjOui6oQyo9YWZ+C+GgDLD/uB4EFGEgDFMshKLYPTiFRxtuwQjqqC/ypWF WJEsluQ4BS33bYfJR417MFdKRCJmkxo8CJuj5RjA6DOCi+q7d7eapGFEGMrfcgVqMm+m XVRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=QNLXQwnn; spf=pass (google.com: domain of prvs=089b491e4=karahmed@amazon.com designates 207.171.184.29 as permitted sender) smtp.mailfrom="prvs=089b491e4=karahmed@amazon.com"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com. [207.171.184.29]) by mx.google.com with ESMTPS id o25si4532388qkk.39.2019.07.12.01.51.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jul 2019 01:51:45 -0700 (PDT) Received-SPF: pass (google.com: domain of prvs=089b491e4=karahmed@amazon.com designates 207.171.184.29 as permitted sender) client-ip=207.171.184.29; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=QNLXQwnn; spf=pass (google.com: domain of prvs=089b491e4=karahmed@amazon.com designates 207.171.184.29 as permitted sender) smtp.mailfrom="prvs=089b491e4=karahmed@amazon.com"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1562921505; x=1594457505; h=from:to:cc:subject:date:message-id; bh=gIX56E206Ygtmlz0jOLcOvzHgmUrVjC3hqqjQDtHYu4=; b=QNLXQwnnBQ/Uu5DrpfAyAnmd2gH6k1oFMuExj9cLVIcKpKRsT9kFvZYT pydDs+QpftBphSSpny/PTnImvKDMujNVefu+fjIJIO40enJs7CK8+deS8 JnuwioAhqgR1bFtyZYoI5vnqhfw/A819W/AZunBNcS2CJaDcJh5/fOmz2 E=; 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000033, 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 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));