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 X-Spam-Level: X-Spam-Status: No, score=-6.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 346FDC433DB for ; Mon, 1 Feb 2021 14:34:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ABCE764E56 for ; Mon, 1 Feb 2021 14:34:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABCE764E56 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3F0DE6B0083; Mon, 1 Feb 2021 09:34:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C7856B0088; Mon, 1 Feb 2021 09:34:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2DD286B0089; Mon, 1 Feb 2021 09:34:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0154.hostedemail.com [216.40.44.154]) by kanga.kvack.org (Postfix) with ESMTP id 189FD6B0083 for ; Mon, 1 Feb 2021 09:34:44 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C74391EF1 for ; Mon, 1 Feb 2021 14:34:43 +0000 (UTC) X-FDA: 77769945246.19.chalk84_2411537275c3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 8C24A1AD1B5 for ; Mon, 1 Feb 2021 14:34:43 +0000 (UTC) X-HE-Tag: chalk84_2411537275c3 X-Filterd-Recvd-Size: 3123 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Mon, 1 Feb 2021 14:34:42 +0000 (UTC) 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> 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 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.