Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4568877imu; Tue, 29 Jan 2019 03:59:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN43N0Q+7cbghpXMbfGxuq2Y+Veo35TfUQVtZ9BfRsIfbzL50DCSInQC+3ccPtlpF6n6s19+ X-Received: by 2002:a63:3c58:: with SMTP id i24mr23760342pgn.284.1548763177180; Tue, 29 Jan 2019 03:59:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548763177; cv=none; d=google.com; s=arc-20160816; b=GPn+wfOcmUkXFvAEL6zVu158gGjfnvgSxfxMVhzzzrBthNBFBFzzPpuBNP80HcGIxF 8QpwxrZb9aT9hVMnl1PRKdrIdN6l5CNx/hxgv2iGuTmeBzzI9isZ9m1lrtXnmjwW84Wr 90FqlONYJTaATUdmw+QcVvBRg2aOz6Ij3SiXwwFBLIJaj6rd4G+1bCwwtHDltuViBYRi wbmYIngIQOysvYYlOjwhb7lMIYslSBBXo45nbJTMF0wsMROijcCrUHu/U/dQ+tdD0haL LdBEW9tARj76uS4luhha3hsozfmUVmypjCQAwKp1uEiBmVt5FJpQLoAbRVXwCjmMzx3Q fysA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=++SS1GpASdBX5PFGSuncTal+VtVK2Zxkte9al+Hu8YA=; b=YfA0ewdx6DsuzWjOTaSNoNc6oFCjUzFlBPLOf925s7rScaotUNJQJvgFuihEUikQl3 lqCPLTMGBSAPa1FDLQPm15V3d9Z533oTW1ZqvZ3tTMu+/aSGGuRlX5RFU+oNvKHGD53R UmvOBihpV+SdHC1n6hmg4b3zLOXaFph4fTReNzWWskWISTPJqM/UPlMnOg1A4Kr7Tb+A DjwSGUM/Gl99hQjj+B5iLjv+nt8lMCKRCJzske8UhHWErZYeffYI2oDBVMOPdbD8t85L 5SOwSnkhfdjAzAHRH5mLVscT2YvR/K/uknyGSJ9DA45KwBdFf+79Z8E30Gj2cTrN2msz 6j0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V9uTZgeD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si20968024pfb.92.2019.01.29.03.59.21; Tue, 29 Jan 2019 03:59:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V9uTZgeD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731184AbfA2LrX (ORCPT + 99 others); Tue, 29 Jan 2019 06:47:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:37978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731172AbfA2LrT (ORCPT ); Tue, 29 Jan 2019 06:47:19 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D94C20882; Tue, 29 Jan 2019 11:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548762438; bh=/B+1Zv3ry4KRryELdIhteJaqUoi/SJfKMkQbQwRO8Xw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V9uTZgeDI1KGx/OmFyeXxfX014252jDApKltE1ErZFr98wKBFa11L3406g1bqX8BI 0sNuB3+BBGPtN0CBMqlKsvrLCmg+LRz0IjOo7z+SZk4tclJhIaZmKZnpsw0X7EQHSV w2m/nC0PDNjeI5tq22Nzmxv/oJaytL3bYH46Chkc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Shteynfeld , stable@kernel.org, Michal Hocko , Linus Torvalds Subject: [PATCH 4.19 101/103] Revert "mm, memory_hotplug: initialize struct pages for the full memory section" Date: Tue, 29 Jan 2019 12:36:18 +0100 Message-Id: <20190129113207.561654704@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129113159.567154026@linuxfoundation.org> References: <20190129113159.567154026@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michal Hocko commit 4aa9fc2a435abe95a1e8d7f8c7b3d6356514b37a upstream. This reverts commit 2830bf6f05fb3e05bc4743274b806c821807a684. The underlying assumption that one sparse section belongs into a single numa node doesn't hold really. Robert Shteynfeld has reported a boot failure. The boot log was not captured but his memory layout is as follows: Early memory node ranges node 1: [mem 0x0000000000001000-0x0000000000090fff] node 1: [mem 0x0000000000100000-0x00000000dbdf8fff] node 1: [mem 0x0000000100000000-0x0000001423ffffff] node 0: [mem 0x0000001424000000-0x0000002023ffffff] This means that node0 starts in the middle of a memory section which is also in node1. memmap_init_zone tries to initialize padding of a section even when it is outside of the given pfn range because there are code paths (e.g. memory hotplug) which assume that the full worth of memory section is always initialized. In this particular case, though, such a range is already intialized and most likely already managed by the page allocator. Scribbling over those pages corrupts the internal state and likely blows up when any of those pages gets used. Reported-by: Robert Shteynfeld Fixes: 2830bf6f05fb ("mm, memory_hotplug: initialize struct pages for the full memory section") Cc: stable@kernel.org Signed-off-by: Michal Hocko Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/page_alloc.c | 12 ------------ 1 file changed, 12 deletions(-) --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5538,18 +5538,6 @@ not_early: cond_resched(); } } -#ifdef CONFIG_SPARSEMEM - /* - * If the zone does not span the rest of the section then - * we should at least initialize those pages. Otherwise we - * could blow up on a poisoned page in some paths which depend - * on full sections being initialized (e.g. memory hotplug). - */ - while (end_pfn % PAGES_PER_SECTION) { - __init_single_page(pfn_to_page(end_pfn), end_pfn, zone, nid); - end_pfn++; - } -#endif } static void __meminit zone_init_free_lists(struct zone *zone)