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 27E35C5519F for ; Wed, 25 Nov 2020 10:39:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 71D112063A for ; Wed, 25 Nov 2020 10:39:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71D112063A 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 B98896B0071; Wed, 25 Nov 2020 05:39:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B216C6B0072; Wed, 25 Nov 2020 05:39:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A109A6B0073; Wed, 25 Nov 2020 05:39:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0228.hostedemail.com [216.40.44.228]) by kanga.kvack.org (Postfix) with ESMTP id 86D8D6B0071 for ; Wed, 25 Nov 2020 05:39:38 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D1FF43620 for ; Wed, 25 Nov 2020 10:39:37 +0000 (UTC) X-FDA: 77522594394.22.swing30_180c05b27376 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id AF45C18038E60 for ; Wed, 25 Nov 2020 10:39:37 +0000 (UTC) X-HE-Tag: swing30_180c05b27376 X-Filterd-Recvd-Size: 2957 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Wed, 25 Nov 2020 10:39:36 +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 CB4E8AC60; Wed, 25 Nov 2020 10:39:35 +0000 (UTC) Date: Wed, 25 Nov 2020 10:39:33 +0000 From: Mel Gorman To: David Hildenbrand Cc: Andrea Arcangeli , Vlastimil Babka , Andrew Morton , linux-mm@kvack.org, Qian Cai , Michal Hocko , 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: <20201125103933.GM3306@suse.de> References: <35F8AADA-6CAA-4BD6-A4CF-6F29B3F402A4@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <35F8AADA-6CAA-4BD6-A4CF-6F29B3F402A4@redhat.com> 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 Wed, Nov 25, 2020 at 07:45:30AM +0100, David Hildenbrand wrote: > > Something must have changed more recently than v5.1 that caused the > > zoneid of reserved pages to be wrong, a possible candidate for the > > real would be this change below: > > > > + __init_single_page(pfn_to_page(pfn), pfn, 0, 0); > > > > Before that change, the memmap of memory holes were only zeroed out. So the zones/nid was 0, however, pages were not reserved and had a refcount of zero - resulting in other issues. > > Most pfn walkers shouldn???t mess with reserved pages and simply skip them. That would be the right fix here. > Ordinarily yes, pfn walkers should not care about reserved pages but it's still surprising that the node/zone linkages would be wrong for memory holes. If they are in the middle of a zone, it means that a hole with valid struct pages could be mistaken for overlapping nodes (if the hole was in node 1 for example) or overlapping zones which is just broken. > > > > Whenever pfn_valid is true, it's better that the zoneid/nid is correct > > all times, otherwise if the second stage fails we end up in a bug with > > weird side effects. > > Memory holes with a valid memmap might not have a zone/nid. For now, skipping reserved pages should be good enough, no? > It would partially paper over the issue that setting the pageblock type based on a reserved page. I agree that compaction should not be returning pfns that are outside of the zone range because that is buggy in itself but valid struct pages should have valid information. I don't think we want to paper over that with unnecessary PageReserved checks. -- Mel Gorman SUSE Labs