From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2481C433EF for ; Mon, 9 May 2022 11:08:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 85D646B0071; Mon, 9 May 2022 07:08:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 80DC26B0073; Mon, 9 May 2022 07:08:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D5F56B0074; Mon, 9 May 2022 07:08:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5DE2D6B0071 for ; Mon, 9 May 2022 07:08:03 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 3117321062 for ; Mon, 9 May 2022 11:08:03 +0000 (UTC) X-FDA: 79445930046.22.83ADA92 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by imf01.hostedemail.com (Postfix) with ESMTP id 5A64440086 for ; Mon, 9 May 2022 11:07:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652094482; x=1683630482; h=from:subject:to:cc:references:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=ssJA0bmg+brCtOxTLgOXtS/A0e6y0MYbmQsr/HcpEoA=; b=e74kbjOT3lLJnkWuNISPFGkQ/3kcLwYNAXuZs02cloA/8W7VBt8himY6 esA6/A+kLI+G+LTwPjntJe9aP+ScHANhFvWkc55vdsnA8vFuxAWDZbRQ0 Rer55amTNzNrnXhz+9iS6T5WWgu6G8tmLSXviBw7ceGq8xTZL57ExCjjG M=; Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 09 May 2022 04:08:01 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2022 04:08:00 -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; Mon, 9 May 2022 04:08:00 -0700 Received: from [10.216.4.129] (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; Mon, 9 May 2022 04:07:56 -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> <7b18bea8-b996-601d-f490-cb8aadfffa1b@quicinc.com> Message-ID: <42f28e7b-c001-7d01-1eb6-fe963491898e@quicinc.com> Date: Mon, 9 May 2022 16:37:30 +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-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5A64440086 X-Stat-Signature: ahmykh4h4q8u7wrqzm1gp3ax7ang618r X-Rspam-User: Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcdkim header.b=e74kbjOT; spf=pass (imf01.hostedemail.com: domain of quic_faiyazm@quicinc.com designates 129.46.98.28 as permitted sender) smtp.mailfrom=quic_faiyazm@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com X-HE-Tag: 1652094471-286428 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 5/5/2022 10:24 PM, Mike Rapoport wrote: > On Thu, May 05, 2022 at 08:46:15PM +0530, 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 > I really don't like memblock_remove() for such cases. > Pretending there is a hole when there is an actual DRAM makes things really > hairy when it comes to memory map and page allocator initialization. > You wouldn't want to trade system stability and random memory corruptions > for 11M of "saved" memory. Creating memory map for holes memory is adding 11MB overhead which is huge on low memory target and same time 11MB memory saving is good enough on low memory target. Or we can have separate list of NOMAP like reserved?. Any other suggestion to address this issue?. Thanks and regards, Mohammed Faiyaz