Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2244238ybi; Sat, 13 Jul 2019 09:54:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKj4Vqr9rrBAyY2Dea2ZOdp8YvrD3I6TtsngVrGs3DC3b7rLs+Xaa4rKvzYK/uDytiwGri X-Received: by 2002:a63:7e17:: with SMTP id z23mr17915622pgc.14.1563036899367; Sat, 13 Jul 2019 09:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563036899; cv=none; d=google.com; s=arc-20160816; b=hValxaJRFeNT8wN9FhjKjX0fj4F79MmyFWwZwMqCk54FStwyviRA7s+axuv91SlUMr Mbc3yGf8A5DQSL37H91kyYTqm7kg0XiFlkjt2oW4taQkhEp0e1w0/GE5X6TTkbA44+9O tPf7PINMzhOq85X4K49PYv3/R5C0aFUNjaow4vbrJp6akD8l+moR0VHxv1VXpQodIOeS G6L7Qu1xvSTecksdvAATNyMrHs3ykVlMv4e0aA98YMfbGmbUpifEjh1ZPDsyLCRX/HLI 14fgH/rGY9Z9TPQHCq3coDlhbV31avI4jqW+CfncoqKLrkd827PYS6m7RlbhL92sYJaU AioQ== 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=QJtleFy0W5wG+kdjcQeK55r7BWM3778hGqddVx/0MZo=; b=XrsiYiquIpBvrwyZrD1kLxVm8+sAWQI3+Pjf2DMdXBdTvp3bVIuvv6vPRtw94wYNjB TrLI14t7u8nJtn3YWZZgp3sGZpB8FOUTAVvhZNVHfHERjLt/UHeNw2ZhU7e9ztCsCexV 3lKFgvAS4AVsIhiJhTbXoMsePNa5qC25N8rIC/xSSHJWMQKrgaVhqfLBZxeuwuPFfU4R 1clwB0cmNU8KoAR9SrXf1+O5oRUdtYPcrCnxcFfRxkQLUjyEy87p+na4zS5kPsnZEyNj TEoRL2EkftnTmgywPyWyUU3CqXFRZJN15dBtFdJhoasqd6GbcmADoSUe2Nwc31hJJIye 9URQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Vm2O5Q/c"; 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 j6si12594441pfi.240.2019.07.13.09.54.43; Sat, 13 Jul 2019 09:54:59 -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="Vm2O5Q/c"; 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 S1727881AbfGMQw1 (ORCPT + 99 others); Sat, 13 Jul 2019 12:52:27 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:42264 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727678AbfGMQw1 (ORCPT ); Sat, 13 Jul 2019 12:52:27 -0400 Received: by mail-ed1-f67.google.com with SMTP id v15so11786774eds.9 for ; Sat, 13 Jul 2019 09:52:26 -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=QJtleFy0W5wG+kdjcQeK55r7BWM3778hGqddVx/0MZo=; b=Vm2O5Q/c3MGDUmRqEb79GmywtMNQUwpvrKPNIkqSH760cGhr+7PbMBMWs0uNtd/66a xp51fGxqAZdeBd6IMqm9Z/46AAtWtCTRtNhrdcD0EHcK0dXYJcMkBNjQOwLXGmUuJ/k/ 3lYxq2jv1c2pz8TzeUK6BoAUhQ8oxACHVO4iFqHOL7toO2CQ1xyPjABeTVlPF916bWeY GZj17ofIBcVfR2W6n9YhRPIzujPGVGvuO4zuyN+4ztTMte49OULTEE5wTHfi0BtL8Qdd 4THAi7172kWjg6H3wGaNhJd9kgA5FqHNYuEsTCLaNB+KH9HW5z6Mf0VNPfP2C02N0uRC ASSw== 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=QJtleFy0W5wG+kdjcQeK55r7BWM3778hGqddVx/0MZo=; b=dG5LsHW1itJ0FcQAMBz3RceZgVRdIJJ8o5JOfHFVGXBz8JUsKb8LmIWbZ3Mn5EuA0p FrBnUjvf/uzz5KpPfcuOgmPkNiI2XrnjsGbrYwz0s6sZLF7Hdv84GW9SBsIMqnnvXxAF ztGvEEid0Ag774vHrdRi/JgN2Y4Ngft+atrBrKW/6+5/rK9xIH29Y1e6aOZEZob+KxLO Wn2olpww8u55HlWOL0OR/w1LWGtjv/+lnVfzd12ePh+oaMLY44RxwlqnrPYz4DdN/FUN Jaopa314Sbksq3yvBmQfQDF4RcSyVjeOeOfOyRHR/YClCTPCaH8yD2o94ewbg8HEz0NE LxBw== X-Gm-Message-State: APjAAAVTDnPPtdUYYZH13ImPLV75y2AZvZxrSUq30cZDAm/sum7oZIhv CJr1Hll6qRnWVxawx9iQuQCANIS8 X-Received: by 2002:a05:6402:14c4:: with SMTP id f4mr14931366edx.170.1563036745777; Sat, 13 Jul 2019 09:52:25 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id by12sm2559899ejb.37.2019.07.13.09.52.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Jul 2019 09:52:19 -0700 (PDT) Date: Sat, 13 Jul 2019 16:52:19 +0000 From: Wei Yang To: "Raslan, KarimAllah" Cc: "richard.weiyang@gmail.com" , "linux-kernel@vger.kernel.org" , "bhe@redhat.com" , "linux-mm@kvack.org" , "cai@lca.pw" , "logang@deltatee.com" , "akpm@linux-foundation.org" , "osalvador@suse.de" , "rppt@linux.ibm.com" , "mhocko@suse.com" , "pasha.tatashin@oracle.com" Subject: Re: [PATCH] mm: sparse: Skip no-map regions in memblocks_present Message-ID: <20190713165219.n3ro7peyyml6swrk@master> Reply-To: Wei Yang References: <1562921491-23899-1-git-send-email-karahmed@amazon.de> <20190712230913.l35zpdiqcqa4o32f@master> <1563026005.19043.12.camel@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1563026005.19043.12.camel@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 Sat, Jul 13, 2019 at 01:53:25PM +0000, Raslan, KarimAllah wrote: >On Fri, 2019-07-12 at 23:09 +0000, Wei Yang wrote: >> 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); > >The nomap is also done by EFI code in ${src}/drivers/firmware/efi/arm-init.c > >.. and hopefully in the future by this: >https://lkml.org/lkml/2019/7/12/126 > >So it is not really striclty associated with the map_mem(). > >So it is extremely dependent on the platform how much memory will end up mapped?? >as nomap. > >> >> 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? > >We actually have some downstream patches that are using this nomap flag for >more than the use-cases I described above which would enflate the nomap regions?? >a bit :) > Thanks for your explanation. If my understanding is correct, the range you mark nomap could not be used by the system, it looks those ranges are useless for the system. Just curious about how linux could use these memory after marking nomap? >> >> > >> > -- >> > 2.7.4 >> > > > >Amazon Development Center Germany GmbH >Krausenstr. 38 >10117 Berlin >Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich >Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B >Sitz: Berlin >Ust-ID: DE 289 237 879 > > -- Wei Yang Help you, Help me