Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2724312ybl; Mon, 19 Aug 2019 06:38:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKZYzYNyA8iGjrALaLq4bQmeBT91g0vncCshkDmQkLKdr38oDq7kijR5lVSlocOYUqQ+6d X-Received: by 2002:aa7:8a0a:: with SMTP id m10mr24737036pfa.100.1566221902007; Mon, 19 Aug 2019 06:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566221902; cv=none; d=google.com; s=arc-20160816; b=m2Guv0/3bkqjTjefex53hkzC+7VNwAnls6vJ+gnwg4o9e5Mgy0RaHYLFtFZ4sMJC4k aLv3NgPZi9XUHF7tH4x/vompnfF+5ryBqDi2DP1jxg7d40D46/S25QKR5JHg0V73Ka5Q O/Ek6dUEqlvlSg6yhFqHgrnI86KhwIxS78y3XxXiXPwDqT64kTit34qUiQczL2X9A6EG xMqEtWSq/n6FksgXnt4N8O2X2vJrOM2n/Hk9kFnkZ85STxHaZkNX+4uuh9XDXMk2fk3o xzDQ4ppNzgL//if1Nmz78OHsTmQE3QLsbcvDaaD1SlAi1hzVOO3lWXx2I28E73JPo1zx NWLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2eXH+r+PSJapi3H+GCq7TqCe0DbPdP5gZOGg3NZmjSY=; b=FvlQHnrt2mCQ9fDIqh9yh98a8sJSRFb79x1TnaupRPs+9C5viztgQtX/xV/gXfQE5I Fl0V26n+E6y+8hb0h6rKNu42hoURwG2ZXu+d4AzcjyPrOgW5HgxHADsEsZrRIPuexFV/ U8yhWgSj2DYKfyTNOAP/Gc9rrr6+NYTGA9FoCkdbGNw2RCbKG3JRF1RL/3Jf8W7AuzUk dAbfyjNMtxiXUq+XpPpfPe5gWPFwO0n7K2a4WHOm7EyB8np98nVxhtSNZ1GFAMd6G6tE lSuMRhv8AX6r2hj1T01CGzJWr7B1wMxL0tvv7F2ycoOfT8GHCar6aQG7AjxRn1GP46OS fpbw== ARC-Authentication-Results: i=1; mx.google.com; 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 c130si10600154pfc.103.2019.08.19.06.38.07; Mon, 19 Aug 2019 06:38:21 -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; 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 S1727711AbfHSNfp (ORCPT + 99 others); Mon, 19 Aug 2019 09:35:45 -0400 Received: from outbound-smtp34.blacknight.com ([46.22.139.253]:49700 "EHLO outbound-smtp34.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727172AbfHSNfp (ORCPT ); Mon, 19 Aug 2019 09:35:45 -0400 Received: from mail.blacknight.com (unknown [81.17.254.16]) by outbound-smtp34.blacknight.com (Postfix) with ESMTPS id 42915BB2 for ; Mon, 19 Aug 2019 14:35:43 +0100 (IST) Received: (qmail 26429 invoked from network); 19 Aug 2019 13:35:43 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.18.93]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 19 Aug 2019 13:35:43 -0000 Date: Mon, 19 Aug 2019 14:35:41 +0100 From: Mel Gorman To: Andrew Morton Cc: David Rientjes , Vlastimil Babka , Naoya Horiguchi , 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: <20190819133541.GP2739@techsingularity.net> References: <20190813141630.bd8cee48e6a83ca77eead6ad@linux-foundation.org> <20190814154929.f050d937f2bd2c4d80c7f772@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20190814154929.f050d937f2bd2c4d80c7f772@linux-foundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 14, 2019 at 03:49:29PM -0700, Andrew Morton wrote: > 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. Bit late as I was offline but FWIW Acked-by: Mel Gorman That said, the overhead of the debugging check is higher with this patch although it'll only affect debug builds and the path is not particularly hot. If this was a concern, I think it would be reasonable to simply remove the debugging check as the zone boundaries are checked in move_freepages_block and we never expect a zone/node to be smaller than a pageblock and stuck in the middle of another zone. -- Mel Gorman SUSE Labs