Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp266260pxu; Wed, 25 Nov 2020 02:34:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrIWWjAKjEmgBtGaGhVLVkDJHUBARY/REYEwmPmm4Fz68XZeuNOAdFSzI2GWBuh16y6QRp X-Received: by 2002:a17:906:168e:: with SMTP id s14mr2453795ejd.464.1606300486171; Wed, 25 Nov 2020 02:34:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606300486; cv=none; d=google.com; s=arc-20160816; b=oQeSVumX+NcePpnNpAA0lo/elTCfc/uA5acQNJu69DZu4smf1Bok0x1PgWlzf2S9VM gynUurmcNS/JzH/MeDrU1phaFvnfWqKCBvF6Mp5yTFdLvO+U1Jb4Ht0/q1kSuaoGrU7J QnZJVI6wRHLqsq9zXmyrtkkSGIP6ZwriM9uC6ExTmlD91L0ItluwYnq0mzNvOaZmfrct gDkVyPxSJIImBVUrb+3LlVvovWWWGHiNL/cIPXsnrbQ229sI/U+um/Bem/26RzJJirc0 ZQ2vtWjitvSYhz1CwqnQhVJOxeE9B4+lUlEg8cU9b+o7s0HxpO/Mnt8km8tX+b5Vh8MC 0/WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=lpBP+b/iHMnaaAqzH+qkPQ63BAvE1vojX0aajqhzCmA=; b=GGINA1mxOdAi3AKT6TDmQHepQNZe2wn7LWcVVnPw1Fexu7PHO3nraxhxXZGGspk73n uGSfeSlPCkWWfWS1gNKUS0q4WF96JOa511Ejmad+EaWX9wTrPeX1cNa1oLVAKJcRq1Y8 YgPD6RiJy/pTuIjH/i/wpJ8/Z+9He/vYyr3xbx0nmXnNukMPD0T9okAv8RFyQoLKQrB7 RQNTGkYUIzdT9G0G0UU9z6lssZISvVWOLZjXXSKzYUyqKcwhrhOy+sJ1DANUBC8LH9UA Ij7Sox8NgrqKeXcvGsW1yhZmWXC4FWHJkUW+PiqkSdVSfSyzPxK4/gRmC7Ep6ivHInUu KSAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si1020904ejk.493.2020.11.25.02.34.23; Wed, 25 Nov 2020 02:34:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728439AbgKYKa5 (ORCPT + 99 others); Wed, 25 Nov 2020 05:30:57 -0500 Received: from mx2.suse.de ([195.135.220.15]:56660 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727982AbgKYKa5 (ORCPT ); Wed, 25 Nov 2020 05:30:57 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5C54CAC6A; Wed, 25 Nov 2020 10:30:56 +0000 (UTC) Date: Wed, 25 Nov 2020 10:30:53 +0000 From: Mel Gorman To: Andrea Arcangeli Cc: Vlastimil Babka , Andrew Morton , linux-mm@kvack.org, Qian Cai , Michal Hocko , David Hildenbrand , linux-kernel@vger.kernel.org, Mike Rapoport , Baoquan He Subject: Re: [PATCH 1/1] mm: compaction: avoid fast_isolate_around() to set pageblock_skip on reserved pages Message-ID: <20201125103053.GL3306@suse.de> References: <8C537EB7-85EE-4DCF-943E-3CC0ED0DF56D@lca.pw> <20201121194506.13464-1-aarcange@redhat.com> <20201121194506.13464-2-aarcange@redhat.com> <20201124133205.GK3306@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 24, 2020 at 03:56:22PM -0500, Andrea Arcangeli wrote: > Hello, > > On Tue, Nov 24, 2020 at 01:32:05PM +0000, Mel Gorman wrote: > > I would hope that is not the case because they are not meant to overlap. > > However, if the beginning of the pageblock was not the start of a zone > > then the pages would be valid but the pfn would still be outside the > > zone boundary. If it was reserved, the struct page is valid but not > > suitable for set_pfnblock_flags_mask. However, it is a concern in > > general because the potential is there that pages are isolated from the > > wrong zone. > > I guess we have more than one issue to correct in that function > because the same BUG_ON reproduced again even with the tentative patch > I posted earlier. > > So my guess is that the problematic reserved page isn't pointed by the > min_pfn, but it must have been pointed by the "highest" variable > calculated below? > > if (pfn >= highest) > highest = pageblock_start_pfn(pfn); > > When I looked at where "highest" comes from, it lacks > pageblock_pfn_to_page check (which was added around v5.7 to min_pfn). > > Is that the real bug, which may be fixed by something like this? (untested) > It's plausible as it is a potential source of leaking but as you note in another mail, it's surprising to me that valid struct pages, even if within memory holes and reserved would have broken node/zone information in the page flags. -- Mel Gorman SUSE Labs