Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp625421pxb; Thu, 25 Feb 2021 10:44:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJytWASIPoERVcl/g/id/huO5OjKbI8xoPNi2N0t+f0Q175k9DYh4mo0TmkEcKMvT0Tq4rqS X-Received: by 2002:a17:906:4088:: with SMTP id u8mr4047734ejj.208.1614278680555; Thu, 25 Feb 2021 10:44:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614278680; cv=none; d=google.com; s=arc-20160816; b=X3eueJV/SEcJdh1ef0GjpPnzy7MCu3QQ4sasjlAMaoVoe3+JFQK3NbfuahqzFJVjtn nbgCnNwrsyRp1UYoLdcL6uwhJLlF2iTruy9H9EiPB3yVtdXq+qL+X0A0oomtkNzJjZ6Y vm42SoINncKyqmHP+PU3VKpbe6G8Y/VBoKW8NpOXdEUphBrNtOjJnAc4PUHSzIksejty ODfzvjdXSnEtrPxLbPvwo9xFup9JfxMF2blN8pGVo4Gs2k0/9DXqX34o5XNDA9eW411q Ye6IwSpRHdOWgxGm4G0aiN/2nlXB256S37RtBmC7tpWCQXhvpX8e99pwpXEy+fHN68n5 HPUA== 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:subject:from :references:cc:to; bh=w9rENW8iVsxoiIdc+O3BPShvB6f/CgxlK0+aolEpQrQ=; b=LEZQYScjYiRrZEIHIJ9j/joahmM/XXjhU7YL7Y1qIveD1gS3nYn0SYPFl1Hu0ZaUjG 1dzh7iVP8Tcx2M/zqAthVfeLoEFYlm2fSHIqeujDc6/FOiO10p5FhccNPxRp7OrCJGlV RASSqrqEPjrgdqREK+74c/5q1oY5zALq1dTqRq0KUK9Ukrgv2fVvFz8xQL0D/Ko1O9pz VijHMEnhbAmdYCz3z99RSH0m3d/C3gSjdG4gj3HXA1l4Z4LPku3JiD8Rgxp7D3S/30gJ dD8Xy1oXwW9b5XgIN6y+5h6WA2c2454doLLHbupSbZ2r3Qsatmr//X3P5KgCeyt71dUT OmHA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j9si3719545edr.342.2021.02.25.10.44.17; Thu, 25 Feb 2021 10:44:40 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233440AbhBYSlS (ORCPT + 99 others); Thu, 25 Feb 2021 13:41:18 -0500 Received: from mx2.suse.de ([195.135.220.15]:55406 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231881AbhBYSji (ORCPT ); Thu, 25 Feb 2021 13:39:38 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3F599AC6E; Thu, 25 Feb 2021 18:38:45 +0000 (UTC) To: Mike Rapoport Cc: Mike Rapoport , Andrew Morton , Andrea Arcangeli , Baoquan He , Borislav Petkov , Chris Wilson , David Hildenbrand , "H. Peter Anvin" , Ingo Molnar , Linus Torvalds , =?UTF-8?Q?=c5=81ukasz_Majczak?= , Mel Gorman , Michal Hocko , Qian Cai , "Sarvela, Tomi P" , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, x86@kernel.org References: <20210224153950.20789-1-rppt@kernel.org> <20210224153950.20789-2-rppt@kernel.org> <20210225180521.GH1854360@linux.ibm.com> From: Vlastimil Babka Subject: Re: [PATCH v7 1/1] mm/page_alloc.c: refactor initialization of struct page for holes in memory layout Message-ID: Date: Thu, 25 Feb 2021 19:38:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210225180521.GH1854360@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/25/21 7:05 PM, Mike Rapoport wrote: > On Thu, Feb 25, 2021 at 06:51:53PM +0100, Vlastimil Babka wrote: >> > >> > unset zone link in struct page will trigger >> > >> > VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page); >> >> ... in set_pfnblock_flags_mask() when called with a struct page from the >> "Unknown E820 type" range. > > "... in set_pfnblock_flags_mask() when called with a struct page from a range > other than E820_TYPE_RAM" > > then :) Better :) >> > because there are pages in both ZONE_DMA32 and ZONE_DMA (unset zone link >> > in struct page) in the same pageblock. >> >> I would say "there are apparently pages" ... "and ZONE_DMA does not span this range" > > I'd rephrase it differently, something like > > "because there are pages in the range of ZONE_DMA32 but the unset zone link > in struct page makes them appear as a part of ZONE_DMA" Much better, thanks! >> > Interleave initialization of the unavailable pages with the normal >> > initialization of memory map, so that zone and node information will be >> > properly set on struct pages that are not backed by the actual memory. >> > >> > With this change the pages for holes inside a zone will get proper >> > zone/node links and the pages that are not spanned by any node will get >> > links to the adjacent zone/node. >> >> What if two zones are adjacent? I.e. if the hole was at a boundary between two >> zones. > > What do you mean by "adjacent zones"? If there is a hole near the zone > boundary, zone span would be clamped to exclude the hole. Yeah, zone span should exclude those pages, but you still somehow handle them? That's how I read "pages that are not spanned by any node will get links to the adjacent zone/node." So is it always a unique zone/node can be determined? Let's say we have: ---- pageblock boundary ---- ---- pageblock boundary ---- Now I hope such configurations don't really exist :) But if we simulated them in QEMU, what would be the linkage in struct pages in that hole?