Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4669417iob; Sun, 8 May 2022 21:19:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCCz4HgCI/htBCD3bxnzzyKkYPhRq4y9TXogAegOvoC8M7mXmdmdoD35caZxYf9Sf/J19N X-Received: by 2002:a17:902:ea57:b0:15a:6173:87d6 with SMTP id r23-20020a170902ea5700b0015a617387d6mr14225337plg.104.1652069979114; Sun, 08 May 2022 21:19:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652069979; cv=none; d=google.com; s=arc-20160816; b=ImxbIP4oFCYDlzVXn2SpCBQr2lbX01FjjYyPlipe18Hwit1SC46QIgBvIBdOzFuQJI P8s14T6UCQQCCGWkaB5T8ZEGrUISUW0d63jn/IogtSsktHG80ghDsvV+iejMjV3UrDlP 2JuCI0BJhG9+1LfPpCEtCbC667UxN0SV0HBMVileFsfyoAe2ai8W2+vEZ83t2SOLSBYg FEXXDD0Y07dgrFLvNcoeaI2BePy0Emo6NQiNC0Ie244mZD+9W9V86ILQS8kVxF3eff/G v0dp+twPdJX6XsCNpM6zJprx/2aNWdd05exSXkea2MzmZwlo5qJeWxLlqY9xT++oE118 Gnug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=rmjiVGuf+I9qAzRqL1/hFE3jsQzkeuoi7JMBhh6xEKA=; b=JL6YZ9aBvDs3bV+QXlMClTlgmG1czUaCwGXwSxEEXhaqapB1yYFh0BisUdhVjGdYuI gH0F5qhj83Xo9FcEhx5G30hQ480XLWElwA7qT2ByZktK5ncxY/tD9EhXkmC1N0w2MA7N mlKTp7tI8ELfiKQBffknhb6ItFEPzLY8SBx72Y94wIKIR1g1qZxdt1t/OnKsJnc5Ii5Q FWJKeTAmeq3r63039xdgoQ0GCX45DYoezTU2kuSWlutBsf/bFInxcA9UXrVOmTQsm6sP /h/TvqGB4EwCY4a7NX3gpU2MTtOiK3UCOUPKU1XB3Wt0xTv2cPveD7nfDjGSETc5MKbQ I6ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=eTBUqKhR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id lb15-20020a17090b4a4f00b001d98af1c348si22027587pjb.87.2022.05.08.21.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:19:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=eTBUqKhR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D578310C829; Sun, 8 May 2022 21:17:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381213AbiEEPVF (ORCPT + 99 others); Thu, 5 May 2022 11:21:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354664AbiEEPVD (ORCPT ); Thu, 5 May 2022 11:21:03 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0747D47054; Thu, 5 May 2022 08:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651763844; x=1683299844; h=from:subject:to:cc:references:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=rmjiVGuf+I9qAzRqL1/hFE3jsQzkeuoi7JMBhh6xEKA=; b=eTBUqKhRI3gZoiW2kvvgjM6ypRx2MfUxEuXwjTQDrDk24fbIzwmomwTx wh4IK445ejd4D94JwmY4sr8EB1JdgEQJpshskR1N4iLbd9Fx8RlOaQ4Sc 7xxU0H4cec5i/II1IX3Bm3aRlmS1nC9gQYVbLE0C7KX8YqxhctHbCKYCs E=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 05 May 2022 08:17:23 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 08:17:21 -0700 Received: from nalasex01b.na.qualcomm.com (10.47.209.197) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 5 May 2022 08:17:20 -0700 Received: from [10.216.37.226] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 5 May 2022 08:17:17 -0700 From: Faiyaz Mohammed Subject: Re: [PATCH] mm: memblock: avoid to create memmap for memblock nomap regions To: Mike Rapoport CC: , , , , , , , , , References: <1649704172-13181-1-git-send-email-quic_faiyazm@quicinc.com> Message-ID: <7b18bea8-b996-601d-f490-cb8aadfffa1b@quicinc.com> Date: Thu, 5 May 2022 20:46:15 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,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 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 --- 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