From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32D85C56202 for ; Wed, 25 Nov 2020 10:31:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 73EC420857 for ; Wed, 25 Nov 2020 10:30:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73EC420857 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D05F66B0070; Wed, 25 Nov 2020 05:30:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C8E826B0071; Wed, 25 Nov 2020 05:30:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7C616B0072; Wed, 25 Nov 2020 05:30:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0207.hostedemail.com [216.40.44.207]) by kanga.kvack.org (Postfix) with ESMTP id 9DF796B0070 for ; Wed, 25 Nov 2020 05:30:58 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 63F681EE6 for ; Wed, 25 Nov 2020 10:30:58 +0000 (UTC) X-FDA: 77522572596.18.grade42_5c109a727376 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 370E1100ED0D0 for ; Wed, 25 Nov 2020 10:30:58 +0000 (UTC) X-HE-Tag: grade42_5c109a727376 X-Filterd-Recvd-Size: 2904 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Nov 2020 10:30:57 +0000 (UTC) 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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