Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1433472ybi; Fri, 12 Jul 2019 16:10:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWGeEdVAKuypSr4NJR9wLYU//XVMkATdRDv3wWzWbqIZISPgnwKHktqtdVAxp0eY/3fqAQ X-Received: by 2002:a17:902:26c:: with SMTP id 99mr15139709plc.215.1562973025445; Fri, 12 Jul 2019 16:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562973025; cv=none; d=google.com; s=arc-20160816; b=wteNr/vbkMpGH5E8Ie/x6SkYEonasTnBVEXVpRuIQcI3jCd45ncAnFtQmhK1PA0+rx YFlTCzkoDjO95TmY7FbD8L1k1CxnvQd/AI0x4BM4ndXSDTohoT4E1178jddM9uRB2AAI yf9haW7rxJR3TBq4Qq3nF8TPSujKMSsvgsVvIJsW/BXpnhdJlWxkRJ/tglVhyWY4XlPB yjR1Xeu/bXf1cFN04Av9UeO8QqLuwnnqESY54Vt1E1fHFJPwGlmW7fUgHDiuq1uuY33t cHa4tkyRxndMiWiV6zito6ic6Au+jqFDV2o9705r97MEnZC3TcA6Ls2RVrDSRsi2FUi8 Hi/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Mp2L3+PxgXR8+xXdOZiEFJ7C433LcerfS54GdFQeN60=; b=OmQMYzTw0Aw4Huq1rcI/gADDbn/S0WJwSCdFaTeMjo7JOdsIqkT0BkQXBNBxDl0yK1 BqjS9YWmD+7XPKxvOkZ1VceSf6Jos6QEFCusqoKB57pLVZeaVXrHYaKTfSXqPlNIjAXG 6hmCo9qiAY1p07keqv6EXbLU0x5ZHFJW+qydXwlpkUveIfgQzCxUZy2vWhZvp0j8V0HU fRlPwejCEmWIe9r+WVLB/JaOIc1mzV43D6CCbN5SfkINWr4T+f8aYOSKRzSUmC2fPso+ QGIjOFViG+36yg+ATgDIna5N47biQKZ0xYS9MN78BNOgrgpSloW3VCtp5N697kvybDaS D0yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LQjMfmek; 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=QUARANTINE 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 w21si9707683pff.263.2019.07.12.16.10.09; Fri, 12 Jul 2019 16:10:25 -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=@gmail.com header.s=20161025 header.b=LQjMfmek; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbfGLXJQ (ORCPT + 99 others); Fri, 12 Jul 2019 19:09:16 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:37947 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727698AbfGLXJQ (ORCPT ); Fri, 12 Jul 2019 19:09:16 -0400 Received: by mail-ed1-f68.google.com with SMTP id r12so10510358edo.5 for ; Fri, 12 Jul 2019 16:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Mp2L3+PxgXR8+xXdOZiEFJ7C433LcerfS54GdFQeN60=; b=LQjMfmekW6FIyum3X8Tu6KAwYJZpsP1W7C4wzzkjJaINWv0Cdlzp1a0TT/rq9nnGz7 2x13o5w8cfwIdeVMkYonffNcDvmOI4oAQpv18KCELSgXrBu6zLzzh6HJ3I/p1GAyABIz +I9BcL3zfHm1V6yjnHRCGnytetrWxHup3dmQ/gcct/WJCE3DA56QZXR/Pebbl5yByrjL f0sSONp5AVLhtR4CYedkha4dVx2Orb+S2YVbJ5tTJmgiJ0bfLKgxQm8GUi2nEng8rtYr xgy/lFiJXPmwb0uN3Mgil2A1RBB3gyoEbdwZpu3fZ95dwkph4943Ei19/VO2U9NzbwYr bxdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Mp2L3+PxgXR8+xXdOZiEFJ7C433LcerfS54GdFQeN60=; b=Rz7QmbWkoqj2CCesWHqO8Pa3qRDMc2GS3/21Uz8MlAntreCksdXdDlUtNyz23+mjJU 2b8+sNbUV4ZFZzPLvzihbFK4fPszsRZf7spuDLf4/ticZkDRo1c9slLijCNHFUJ94To3 kc1tAPj1kQZNkNzhyHEjlzRZzD20YKZHR8/NBxr1H7xzkq5c6fZEMppcbkvl6rwvs9zz lV2pBsYnpRPKARu/LhwNRBqPI68kNhld1meuQZtrZB01YBacuSnO4uzXzfTPgBLjjPGM ToZ9eW6wOz5M1qUocb1nlx8Ezcj0e0IKYh2LOye5wVOA2vU3GjaS5N/i6KjzE0lG0n9Z 7bTA== X-Gm-Message-State: APjAAAXgmKGNxF7Xhj+/cYjZOqYi+R9Zb5W2ql/F26SRTyW8Pu90fN69 2hY3O9np8MdWa5l2USMTuYQ= X-Received: by 2002:a05:6402:14c4:: with SMTP id f4mr11724254edx.170.1562972954833; Fri, 12 Jul 2019 16:09:14 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id c16sm2958237edc.58.2019.07.12.16.09.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Jul 2019 16:09:13 -0700 (PDT) Date: Fri, 12 Jul 2019 23:09:13 +0000 From: Wei Yang To: KarimAllah Ahmed Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Pavel Tatashin , Oscar Salvador , Michal Hocko , Mike Rapoport , Baoquan He , Qian Cai , Wei Yang , Logan Gunthorpe Subject: Re: [PATCH] mm: sparse: Skip no-map regions in memblocks_present Message-ID: <20190712230913.l35zpdiqcqa4o32f@master> Reply-To: Wei Yang References: <1562921491-23899-1-git-send-email-karahmed@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1562921491-23899-1-git-send-email-karahmed@amazon.de> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 12, 2019 at 10:51:31AM +0200, KarimAllah Ahmed wrote: >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)); The logic looks good, while I am not sure this would take effect. Since the metadata is SECTION size aligned while memblock is not. If I am correct, on arm64, we mark nomap memblock in map_mem() memblock_mark_nomap(kernel_start, kernel_end - kernel_start); And kernel text area is less than 40M, if I am right. This means memblocks_present would still mark the section present. Would you mind showing how much memory range it is marked nomap? >-- >2.7.4 -- Wei Yang Help you, Help me