Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4822623iob; Mon, 9 May 2022 02:26:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7gf1jGM+1iGZV6xRAryT3KX1hBbuitwy3MQ/QnKhlellX5VNxmQjknYz+YdHcZISjXWOZ X-Received: by 2002:a17:90b:4c91:b0:1dc:57bc:4caa with SMTP id my17-20020a17090b4c9100b001dc57bc4caamr25305367pjb.10.1652088363184; Mon, 09 May 2022 02:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652088363; cv=none; d=google.com; s=arc-20160816; b=aXJ2bYHMUcptFaJcQlYMue1WgWGkg7bjW4us9kmCZZbT2gVMfV5sbRN2t6BTrFLZ44 GdGc4ikf+SKd1T9TjmG6WJB7tbyVhUo88K6vBu3V+SgToT3CDXlTbFXAFF4hqtR2zIlD GTJEvoAYYcJa67/JRYgVDsRkFAEpcBEfbqYXWQ2ZrxLQJnYhd2Bm2OuoGH3OhivUk40w IXq271Y6ZHORQ5v92Hd2RuHvtLlaQa5pWs6SRXkQ29jbFvjgRmzclTTlHjdLN7QrtXGM xsldvk/FdQEgkYiVe5IGzW3T4FwZ1c0Wk4wXXLq6TkpGk1uw1En0JzpgGxGhR5cVlIPt 4jPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=0jAysgfxLw6iR1hjtDIjJnX2XuvY8MjJnvHM5IUvlXM=; b=UusvNHru3Dd24p75w5UjcT8IGJDReVhsp3PlIWIq6H7DAfefq6HcIPvW5QiyD+c/Bq aBVKjShNfWJCFsSNQlnuBtW++smCl0+1FJhqDi2+lBX5ifDR4FC5tW+K5w0WpbAYMRTg +uhR8b1viuF0+VmlDZtpwD/nNjhXoG2nE0B7/WdHPqumXcjXU3J7SFDfmTE7k9YZvtGg 0ebIbC+D6vM3MLVdhYnOVuDUKjzHWBN0Ozdt2w/tfshaM/aNYk/JsLE1CSmssJ0cumc/ TMFuEffLlooXyV11FMatv3Y7JfTyUHhX0Lt6MhMpadFOnot1XwVjjSs6ZA48nK70iunt 8vHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IuEL6pCf; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m19-20020a170902c45300b001589d3cab77si9702088plm.388.2022.05.09.02.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 02:26:03 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IuEL6pCf; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D4A055B3D0; Mon, 9 May 2022 02:15:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357638AbiEEPfH (ORCPT + 99 others); Thu, 5 May 2022 11:35:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243039AbiEEPfA (ORCPT ); Thu, 5 May 2022 11:35:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E7113B2A3; Thu, 5 May 2022 08:31:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CE55C61CEB; Thu, 5 May 2022 15:31:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BBACC385AE; Thu, 5 May 2022 15:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651764678; bh=sPIo4DFRBYDXNLF9h52050tG2IIqnqgkCur/2xVX4RY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IuEL6pCf+Eii24RzycPRwG0r4ohcorRk6bDSYHA40PghP1aqdXmFTE4NMDazOaoM+ Vq56pNXFGt6/X2NN14zCRqcEaUBeNXUT7ktjgNEhW7RVk53ZcWKYObq5XOd3BcW1cM dlWLWny3HWBxTrZ9cIjfBJNVUC9U/uwbeXeSzRDSpgg5aIGteFDop8srQVh+0wSbS1 q/UoCIjzEWjTz3jxO3iduBPL5MjtbRrEQycA/PgLmSghRzTqi/edXyiiVKaXuuTMEQ za8tLZg4k7/fLyqpYkd/+S3eJJwP2rNXBJ7voenBSl9tsWbdXzH08VkHnVMnPeox9D 0+JNUUCfhu9YA== Received: by mail-pf1-f173.google.com with SMTP id i24so3911736pfa.7; Thu, 05 May 2022 08:31:18 -0700 (PDT) X-Gm-Message-State: AOAM531XspIzYmJAz5as66ztBA5eV55/A0eh3nO7n7tdX8gMEOGtuswp mLQm7fouD7E1mOZVU1c7E4dxGDh17MyYcQT64g== X-Received: by 2002:aa7:9519:0:b0:510:5175:7649 with SMTP id b25-20020aa79519000000b0051051757649mr5997617pfp.15.1651764677741; Thu, 05 May 2022 08:31:17 -0700 (PDT) MIME-Version: 1.0 References: <1649704172-13181-1-git-send-email-quic_faiyazm@quicinc.com> <7b18bea8-b996-601d-f490-cb8aadfffa1b@quicinc.com> In-Reply-To: <7b18bea8-b996-601d-f490-cb8aadfffa1b@quicinc.com> From: Rob Herring Date: Thu, 5 May 2022 10:31:05 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm: memblock: avoid to create memmap for memblock nomap regions To: Faiyaz Mohammed Cc: Mike Rapoport , quic_vjitta@quicinc.com, KarimAllah Ahmed , Quentin Perret , Andrew Morton , linux-mm , "linux-kernel@vger.kernel.org" , Frank Rowand , devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 5, 2022 at 10:17 AM Faiyaz Mohammed wrote: > > > On 4/12/2022 10:56 PM, Mike Rapoport wrote: > > On Tue, Apr 12, 2022 at 12:39:32AM +0530, Faiyaz Mohammed wrote: > >> This 'commit 86588296acbf ("fdt: Properly handle "no-map" field in the > >> memory region")' is keeping the no-map regions in memblock.memory with > >> MEMBLOCK_NOMAP flag set to use no-map memory for EFI using memblock api's, > >> but during the initialization sparse_init mark all memblock.memory as > >> present using for_each_mem_pfn_range, which is creating the memmap for > >> no-map memblock regions. To avoid it skiping the memblock.memory regions > >> set with MEMBLOCK_NOMAP set and with this change we will be able to save > >> ~11MB memory for ~612MB carve out. > > The MEMBLOCK_NOMAP is very fragile and caused a lot of issues already. I > > really don't like the idea if adding more implicit assumptions about how > > NOMAP memory may or may not be used in a generic iterator function. > > Sorry for delayed response. > Yes, it is possible that implicit assumption can create > misunderstanding. How about adding command line option and control the > no-map region in fdt.c driver, to decide whether to keep "no-map" region > with NOMAP flag or remove?. Something like below No. That just added another dimension to the test matrix. Having things from multiple sources is always a mess. > > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -1180,8 +1180,10 @@ int __init __weak > early_init_dt_reserve_memory_arch(phys_addr_t base, > */ > if (memblock_is_region_reserved(base, size)) > return -EBUSY; > - > - return memblock_mark_nomap(base, size); > + if (remove_nomap_region) > + return memblock_remove(base, size); > + else > + return memblock_mark_nomap(base, size); > Thanks and regards, > Mohammed Faiyaz >