Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp269595pxu; Wed, 25 Nov 2020 02:41:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwUUhKGqDBlt7ZCmRjuQKxPNs//MuBC2XwBw2KopW7hd3zFlVX6j7gQ6zDzdag98AmTZxI X-Received: by 2002:aa7:cb4a:: with SMTP id w10mr2796416edt.343.1606300887917; Wed, 25 Nov 2020 02:41:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606300887; cv=none; d=google.com; s=arc-20160816; b=vN6PanGdzjUlF0TtvFE/LqrffQSyugRXWnhwwZsaNFEeS6lrjqDoSbeO7VnNSGCqLh uocoGO3clh1WVMsM3DFVYNOJcBPMbZLuWPzGY9VP3H0MuOGQUJD7tL1UJSX3fqeNWx2r Nw9P97hbOwZ3tQp/7biVwVyCm3xbD7G1F4AUusLopFt5oyAROtLLAWNn90D7w32Xwqmw 55xU/miQ8VQoO+Bp9SOtE9K58FIE7LZfw13ZUHTetK5vVE3Jb6DbszQtQlMGwEiX79eB 8oKwjdwHQ2db5sHJ4rpwOlTRWZvu/XmDYpmGITFtLDj1lwi4R796+MKc77En93eRzKL5 U3+g== 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=FFJXnMX3FlRv6aKadNUlNcVRDQl8cjVeO1xlpAdR3O4=; b=TovANIpUagIHlewHCxDKyXdc00JxEp59oBKj3kEajj6BGpSkCqKs2gvyFcmvHXFfSL T4EBk5KQBiblO+aMZG8gVcdtWKxy9cDguQi0GKR/GqnoDvlNok/TSSPobvUA1UzdRLGw nL5SFgSv7ja1V7XAzA6OLlqtZjtIEuBNmfbdStR7xa2rFGQqJZ0KKqkNO2yHWe3/EAO2 vXIRVPl9SaDzQqU30+4XX+f6goczUm/Nljuf8/R9mlzrReGdj1Y8NaD3tpJsC92s56AK VQPOMqWdufLJDiZstBtmAFerkAOwUtYUsqPTxWy1OS3ZLMws3QSt0PSReT9vmkNP1ZGX 9tlA== 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 i5si927726edx.188.2020.11.25.02.41.05; Wed, 25 Nov 2020 02:41:27 -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 S1729171AbgKYKjh (ORCPT + 99 others); Wed, 25 Nov 2020 05:39:37 -0500 Received: from mx2.suse.de ([195.135.220.15]:41922 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728295AbgKYKjg (ORCPT ); Wed, 25 Nov 2020 05:39:36 -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 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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