Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1526096ybl; Tue, 13 Aug 2019 14:17:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3TUVC/kTBT6ScrOeQdO6nZ9OfJ1fQFrTjBdFluEAyPaCbtBoSlqpfJuO2j+w3glFjmeKP X-Received: by 2002:a63:b346:: with SMTP id x6mr36351175pgt.218.1565731072632; Tue, 13 Aug 2019 14:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565731072; cv=none; d=google.com; s=arc-20160816; b=pt81/Sr6hYegw+CXBXaG0aW9/6n2xZA19Bua04qStrXyLLiJfHUNeD5wu7YfVajdVb dYYs7VZoZX1tyRUP5XHk7mpJ644AY86FR1dmyTeJp7kzHvB+QP6Hkcw+mHG5OBXMqwpZ VDL/tiqzOhL+zzLev3E12rPeWE6OSMIg0pZ0qcL6wZys2yHDsLXbQ6Vvgw26H96T9Tdq qG52dBeQDz0UMDR0kdk/wtWAWrwqKrnKgxDQGzu8vuZql8Qxev79kVQafwnKNi4FASju +GhRmxiKP+IXun0W+APaEYYtlsy/6DU/ODnLTdgHaPntfi4yPnf6qnf82TJnWo2SIMVz HUdg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=GhxafJaeXLgVPphGibtPPa7PHszpeQIMTm6ZCPlG2eU=; b=jU3uTz1vZtk22/PoWDWvCpWkK2O6tGyL5Hu56WpIF3xuPnHKrAR9i3KGOYf4SI/Zhj LvaYMylrJgDaLlgDDV/HQgAEywWzKk82E1bduz/0BnU7GSDXmQ9DMZIZ/aXGjM0WJWsK 0fMieJZK0yIVp8UTRqtjIBvLyZmBB6N2/7RdziW8nJKTETIH4juuKj+dSryRYJteyToU euk8NfywbPaoO58zj7qiPhRhUZNolsVF/Y56hPuZnVQGYBETabhy+QZtklk7LWzrZJku 7Lj+1wqqZGbHsBybjPV0c5/PAfSm877UmTIv2esU3MYVNKjtW2sx2xXI6AXYX2eZxCs1 Hocg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OkG7Qgjo; 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 b6si67382898pfa.76.2019.08.13.14.17.34; Tue, 13 Aug 2019 14:17:52 -0700 (PDT) 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=OkG7Qgjo; 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 S1726767AbfHMVQc (ORCPT + 99 others); Tue, 13 Aug 2019 17:16:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:53546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726188AbfHMVQb (ORCPT ); Tue, 13 Aug 2019 17:16:31 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (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 D5EA8205C9; Tue, 13 Aug 2019 21:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565730991; bh=5lO5nG45fLOHTgE1yvwYm5c55LUdkLb+cAFPTo7XcbE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OkG7QgjoGy1/FLMnWjN6QVHtQGDQE7lx3AF09Wq1TzQirB9nW7PhsZgi97LYakzAS kpNmEhjjpIsqmSORExdEosdrLv2gJP/YeSBEFOMn1H5v5ee8hvFz/1qjptsMpcWS3X KSFzaA/tLs+FDl9iSVKMYNQ4/gNMWqHEiPVBbtww= Date: Tue, 13 Aug 2019 14:16:30 -0700 From: Andrew Morton To: David Rientjes Cc: Vlastimil Babka , Naoya Horiguchi , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [patch] mm, page_alloc: move_freepages should not examine struct page of reserved memory Message-Id: <20190813141630.bd8cee48e6a83ca77eead6ad@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Aug 2019 20:37:11 -0700 (PDT) David Rientjes wrote: > After commit 907ec5fca3dc ("mm: zero remaining unavailable struct pages"), > struct page of reserved memory is zeroed. This causes page->flags to be 0 > and fixes issues related to reading /proc/kpageflags, for example, of > reserved memory. > > The VM_BUG_ON() in move_freepages_block(), however, assumes that > page_zone() is meaningful even for reserved memory. That assumption is no > longer true after the aforementioned commit. > > There's no reason why move_freepages_block() should be testing the > legitimacy of page_zone() for reserved memory; its scope is limited only > to pages on the zone's freelist. > > Note that pfn_valid() can be true for reserved memory: there is a backing > struct page. The check for page_to_nid(page) is also buggy but reserved > memory normally only appears on node 0 so the zeroing doesn't affect this. > > Move the debug checks to after verifying PageBuddy is true. This isolates > the scope of the checks to only be for buddy pages which are on the zone's > freelist which move_freepages_block() is operating on. In this case, an > incorrect node or zone is a bug worthy of being warned about (and the > examination of struct page is acceptable bcause this memory is not > reserved). I'm thinking Fixes:907ec5fca3dc and Cc:stable? But 907ec5fca3dc is almost a year old, so you were doing something special to trigger this?