Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1412628ybl; Wed, 14 Aug 2019 16:49:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYxsQfZlCmn1cqen3aEMea4xVGlbs/5IoLjqfoQeBmRkd7PYUhTSBlg8GmQRm/Wn/Xl54F X-Received: by 2002:a17:90a:2047:: with SMTP id n65mr413207pjc.5.1565826576912; Wed, 14 Aug 2019 16:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565826576; cv=none; d=google.com; s=arc-20160816; b=Rw5vVpvA0vir2rRty2iuUXLDogzC+CUFCv70qEAWA0t1F1OfEc6eHsg1GeDV7IXuX6 I88b3bmkCyxiMCAdiZBezKyvcvt9oA0YgEzEvovC4HMqRQJVEr/mdYrjywKxeEP1GEIS qjHAgEpZT2o8M1Q1LHx+yXyEhUHg9j/nAvnCQO2EerA3354OfJACsxzW0rfZXYxlN48T mhvGaWC46p4mKyTThJ2ZaMxr6xDLhObrFABE0gDOBPj+XW2YWdQckdPTaHSkbNwp02/A 1SyKkGFWCKnomIqU1VXJHBVXaxAFnujVthgmMAsF4/JNQNJJiIU0D52MPrpESlASPJG4 EG2A== 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=Ko25M7d/lYg3R/IjII09Bi0qO4Y9t4N541Ni74/ze7Y=; b=Ayz35nmwzwZ2wHvd3XFlclxvOKtsn9pmgE3iClIHpbzyRZ6DihFg0DHA1J5ND3tgPs c8ry0OQ++L28EsWDr2lzU+M5/LISHCBXCKIHzbdOFbTPb9WmpjMsaCZiI3BGoKgto8DE 4yOS5MFCVAAun7TNbLrQ7Zhtm8skcPkxPqKpDjEmaM+ALoYzgcZ9thfsEHb/6mw4V+5O cNI+s+P/ppp3qxp+GkilaD2T0dy+rMTcYo6s/HLbqo9piHB7jmrilL0nnkVOgNmexH8u jOmaTIRByp7NDjQEPMw/7kXv8aYQ4C44xfV4ZRoVTAdnzH3rLSN6zL3bszwkS4s6krB6 BTag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AEyC3bO5; 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 188si715570pgf.193.2019.08.14.16.49.05; Wed, 14 Aug 2019 16:49:36 -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=AEyC3bO5; 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 S1728980AbfHNWta (ORCPT + 99 others); Wed, 14 Aug 2019 18:49:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:38650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728214AbfHNWta (ORCPT ); Wed, 14 Aug 2019 18:49:30 -0400 Received: from localhost.localdomain (c-73-223-200-170.hsd1.ca.comcast.net [73.223.200.170]) (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 A59C9208C2; Wed, 14 Aug 2019 22:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565822969; bh=jivfAMepI0RUEpSZlQtSBIqThWImtRCXpi21oTCQTL4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AEyC3bO50FxmVPrQA2snFZCblJWdXrtODi/2F368XEFE6EwllYrn61TVyVwiklr+M 41FZYVj3/ITFicX9hQXRcaNzdphMeDFeC9pxp15jEgjtlDBTdxgeedz4+0+3rtiX+V SY8knh1Dj7cuDUsu2alp1f4KqD/Yd05rMFu6yrpU= Date: Wed, 14 Aug 2019 15:49:29 -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: <20190814154929.f050d937f2bd2c4d80c7f772@linux-foundation.org> In-Reply-To: References: <20190813141630.bd8cee48e6a83ca77eead6ad@linux-foundation.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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Aug 2019 16:31:35 -0700 (PDT) David Rientjes wrote: > > > 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? > > > > We noticed it almost immediately after bringing 907ec5fca3dc in on > CONFIG_DEBUG_VM builds. It depends on finding specific free pages in the > per-zone free area where the math in move_freepages() will bring the start > or end pfn into reserved memory and wanting to claim that entire pageblock > as a new migratetype. So the path will be rare, require CONFIG_DEBUG_VM, > and require fallback to a different migratetype. > > Some struct pages were already zeroed from reserve pages before > 907ec5fca3c so it theoretically could trigger before this commit. I think > it's rare enough under a config option that most people don't run that > others may not have noticed. I wouldn't argue against a stable tag and > the backport should be easy enough, but probably wouldn't single out a > commit that this is fixing. OK, thanks. I added the above two paragraphs to the changelog and removed the Fixes: Hopefully Mel will be able to review this for us.