Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3862660pxb; Mon, 1 Feb 2021 06:38:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2OqhJdKgqaMovbtblkVGhYC5aniUfyXdQvTSMIUSSrYebkrxSwCx5BMJkuBSOHCDdM7Nd X-Received: by 2002:a5d:4c84:: with SMTP id z4mr17976486wrs.289.1612190308011; Mon, 01 Feb 2021 06:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612190307; cv=none; d=google.com; s=arc-20160816; b=IjCFWlj5igpFcHmf20aaxum4syv6hiQjWJvdBq/PGxtNun5cJ6vxd8zaPpUlbr59Cm F/JAAt7/5kH/t8aAab5CmW5m/fRm+qNPipbuEMQj+y5lJAlpuP35BdXrNqMHTuGpiazL 6bx9hTYuogecqVCMbrMaHb9f+SR3CkqgwY2wuWeqUMPMkT51qFR70uZqKUaBqrZVVd8U gA/DhuDofM/ys5kbqZ69fqb5P3ae2jN2EvNICnZZF3cGqvyIOZcPdNXJabx9m78uANUa 7adsMdiQU9AQDMSD6EA9CaAMRUNGZeLtOCckhyEhgkotaT/EloTfw9QxMfhbFvlovJDY QsRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=D+aaLzJAYHeBbScfe55MBnvW0NpgfrIZ5sGraBQh6Xw=; b=aZWvD0PEq7zEHc4AjJ7S6xLE9ACCEVylmHkWhydXBsLeRYLoEAeaMSsRAgZOA1Eeo1 yGoORAXK63IReZrxxc99SnJFRHJ8PAVgE6inDOAND8xlEcINVIhPWaZyKn7QIiNDANdX iSZlYai/faOoVZm0UYT7RkU5pVCEebiqudm61XmbujQy8LhHVPUF8MAYJwcU9HO509bi VWEJXln9OVHW7s7fzYIDAyNSnE8E5LaW+xFkSdfjAMqRglMUX+vgcQZsrSxHVTCXCdux Ih0C0TImkvajuKncrgOPGqwYTcgMhc8XYSGlPysI8yUK/fBM+fTOTlgageDvH9Zh0QoM 9WNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y0AqnHNb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bc26si1048067edb.476.2021.02.01.06.38.02; Mon, 01 Feb 2021 06:38:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y0AqnHNb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231131AbhBAOfe (ORCPT + 99 others); Mon, 1 Feb 2021 09:35:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:59556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231136AbhBAOfX (ORCPT ); Mon, 1 Feb 2021 09:35:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4AC2460C41; Mon, 1 Feb 2021 14:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612190082; bh=y1WIXhQf1MNfS1FPxWGyuvnTlyipMve7MwfnSTBmv6s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Y0AqnHNbQAdKqs/Z3IjF2PCzZ6m2kolaPMzVt2xxFzWHqZ19BKS8lLLQP6cLQ4PGN qJhAFv7Og9Zj7117MJqMkdwn1YeVVmlYq5ocUAP3x1XcPUj5lYzzE7qg43frssnwvG aNdS3FTP+4bJxP0R84Q0/fkiZmuEXsXsm0Yt7k/EBC1RetOMZTWwvRKWF17Gf2imiI zPyM97v6FJolmQrFNigGeNgFIiQvykKWH6hlaqJVIpabOvmSmMIIj4yjbjhltTJj9L Ofv8qMTbbsV9PZR/tz02JU+lW03PhwDsYWQpZQHFkKMZJ0L60EIFY4fZJczB23icAj QQUG6X5ZAWziA== Date: Mon, 1 Feb 2021 16:34:29 +0200 From: Mike Rapoport To: Baoquan He Cc: David Hildenbrand , Andrew Morton , Andrea Arcangeli , Borislav Petkov , Chris Wilson , "H. Peter Anvin" , Ingo Molnar , Linus Torvalds , =?utf-8?Q?=C5=81ukasz?= Majczak , Mel Gorman , Michal Hocko , Mike Rapoport , Qian Cai , "Sarvela, Tomi P" , Thomas Gleixner , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v4 1/2] x86/setup: always add the beginning of RAM as memblock.memory Message-ID: <20210201143429.GJ242749@kernel.org> References: <20210130221035.4169-1-rppt@kernel.org> <20210130221035.4169-2-rppt@kernel.org> <56e2c568-b121-8860-a6b0-274ace46d835@redhat.com> <20210201112605.GA2357@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210201112605.GA2357@MiWiFi-R3L-srv> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 01, 2021 at 07:26:05PM +0800, Baoquan He wrote: > On 02/01/21 at 10:32am, David Hildenbrand wrote: > > > > 2) In init_zone_unavailable_mem(), similar to round_up(max_pfn, > > PAGES_PER_SECTION) handling, consider range > > [round_down(min_pfn, PAGES_PER_SECTION), min_pfn - 1] > > which would handle in the x86-64 case [0..0] and, therefore, initialize PFN > > 0. > > Sounds reasonable. Maybe we can change to get the real expected lowest > pfn from find_min_pfn_for_node() by iterating memblock.memory and > memblock.reserved and comparing. As I've found out the hard way [1], reserved memory is not necessary present. There could be a system that instead of reserving memory at 0xfe000000 like in Guillaume's report, could have it reserved at 0x0 and populated only from the first gigabyte... [1] https://lore.kernel.org/lkml/127999c4-7d56-0c36-7f88-8e1a5c934cae@collabora.com -- Sincerely yours, Mike.