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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 0BBAFC49EA6 for ; Thu, 24 Jun 2021 20:57:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 83C0A613C2 for ; Thu, 24 Jun 2021 20:57:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83C0A613C2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 293266B0011; Thu, 24 Jun 2021 16:57:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 242966B005D; Thu, 24 Jun 2021 16:57:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E45A6B006C; Thu, 24 Jun 2021 16:57:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0174.hostedemail.com [216.40.44.174]) by kanga.kvack.org (Postfix) with ESMTP id CE3696B0011 for ; Thu, 24 Jun 2021 16:57:25 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EA66318264875 for ; Thu, 24 Jun 2021 20:57:25 +0000 (UTC) X-FDA: 78289828050.38.BC83C13 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf10.hostedemail.com (Postfix) with ESMTP id 7AB404202A03 for ; Thu, 24 Jun 2021 20:57:25 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 475FF60FF1; Thu, 24 Jun 2021 20:57:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1624568244; bh=u/gehyKLEMLPDqkaXJpcfLQFYkfHJRSEg6Syn2xn4YI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=d375zGYlRkEZ2Yb4UxAtr5w7JBXVAWDc0shJglPVjCxKXOoatFiaMGjvNe7jXcm+t khcbiaVCziTXa4PhCK/5rwOdmvOb2UTcR0eJGPDhhmVE4pD/nzy05Cm0BzLyjFerZN 7BK1it2C9BX7LoB51jRIwMSnVd30rIzbE/WjILsA= Date: Thu, 24 Jun 2021 13:57:23 -0700 From: Andrew Morton To: Mike Rapoport Cc: alfalco@gmail.com, Borislav Petkov , Mike Rapoport , robert.shteynfeld@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/page_alloc: fix memory map initialization for descending nodes Message-Id: <20210624135723.3b2b25de43e22ab4275ea273@linux-foundation.org> In-Reply-To: <20210624062305.10940-1-rppt@kernel.org> References: <20210624062305.10940-1-rppt@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=d375zGYl; dmarc=none; spf=pass (imf10.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: ak6gu4x1ajpc9ujzn9sahcjzu69z5due X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 7AB404202A03 X-HE-Tag: 1624568245-263559 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 Thu, 24 Jun 2021 09:23:05 +0300 Mike Rapoport wrote: > From: Mike Rapoport > > On systems with memory nodes sorted in descending order, for instance > Dell Precision WorkStation T5500, the struct pages for higher PFNs and > respectively lower nodes, could be overwritten by the initialization of > struct pages corresponding to the holes in the memory sections. > > For example for the below memory layout > > [ 0.245624] Early memory node ranges > [ 0.248496] node 1: [mem 0x0000000000001000-0x0000000000090fff] > [ 0.251376] node 1: [mem 0x0000000000100000-0x00000000dbdf8fff] > [ 0.254256] node 1: [mem 0x0000000100000000-0x0000001423ffffff] > [ 0.257144] node 0: [mem 0x0000001424000000-0x0000002023ffffff] > > the range 0x1424000000 - 0x1428000000 in the beginning of node 0 starts in > the middle of a section and will be considered as a hole during the > initialization of the last section in node 1. > > Reorder order of the memory map initialization so that the outer loop will > always iterate over populated memory regions in the ascending order and the > inner loop will select the zone corresponding to the PFN range. > > This way initialization of the struct pages for the memory holes will > be always done for the ranges that are actually not populated. Changelog doesn't tell us what are the user-visible effects of the bug. > Link: https://bugzilla.kernel.org/show_bug.cgi?id=213073 But that does. Panic during boot. > Fixes: 0740a50b9baa ("mm/page_alloc.c: refactor initialization of struct page for holes in memory layout") > Signed-off-by: Mike Rapoport So I think we want a cc:stable here?