Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp326203pxu; Wed, 25 Nov 2020 22:38:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1wxMd5sEW3YT+qf/EzBD1guav6E8wvVSdOJ2eEH4nQJd8EXiIMBjfsSz0ePmAbluzwiMq X-Received: by 2002:a17:906:3ecf:: with SMTP id d15mr1358919ejj.297.1606372711598; Wed, 25 Nov 2020 22:38:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606372711; cv=none; d=google.com; s=arc-20160816; b=a75NuPlZ24rn+CSsX0mCSl2KTFrqXlkQPLxwt5xtrxVmBlOt0V7y2rmo5ptcr2ErUa aKZCzbX/RrsdYwBKdOyPjJL9AGH4JqT6/nhL7XEKcWYfBHExp4Me59u1fW8WWBqCNvQh GKEa8DdHrw/ZfDwbbCxubZT9QD7twAOvgrGHQAA2NbeTDAukjRQY/Tu+S23zusbvtbqs 8lVAExZXnDlMzzeJjN6uprYe1oDff5YC0tBixU2HeaMZWrUVzbLLn/8Sz4j2j/vLcJwd q8M+azs6FOTTdh415C7PU4YTcINfgGEWrQ5NmxCp5FBH0gcihNNzwg6nmw0Y3tTSNVya u1oA== 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 :dkim-signature; bh=k3kz6C4a6AtRNaq6oY0n9BienKaRknyUdLMKhNfj96A=; b=CoH2bVnzPf/3W3TEjt8H2tU6ems8Ob8LX1RxFJNmxEZT5V6aInloVMKjSuxdWvKAke 6gLs5Bdt4QSxpDCHrgClqP9n5+F9o4x0rTfNSt2wIC3CE9MxoTy0CUl5U7quUnIwEh4m y4hUa5KDq7PveGEf+dSkOohuIGa4H5Il3gaYZeoGzova+LjgIomtnYyo/JZmfYGAi4dI Ga3TieyQlcqZEMZhlt/c0EPrW3SeA1O74N7dAXSOB/HUjpjWO8SnSdGDwJDXW8Zk9JbJ +E6cUecvBBVkQp0Ew5xnM21pokQTd0hH4C6kj1A0VNGyQwuRt79TiFouV5oGRHLr99Gm wwMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LMgh6+Kx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p89si2491576edp.328.2020.11.25.22.38.09; Wed, 25 Nov 2020 22:38:31 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LMgh6+Kx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731764AbgKYSrb (ORCPT + 99 others); Wed, 25 Nov 2020 13:47:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45393 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730520AbgKYSra (ORCPT ); Wed, 25 Nov 2020 13:47:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606330049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=k3kz6C4a6AtRNaq6oY0n9BienKaRknyUdLMKhNfj96A=; b=LMgh6+KxQdKRIw9OWXw57bLXQTGOB5pli+jXW+0ylj2cUYqNwFaCiblj4ZzHG5VEReMSLQ uExT9h6tGc+Rv8YdPVMEt8KC5iSaFuh2VLNPqXY1YQKYsIzwmzrdbGj38Akw6jcz9KGxyY yOON2xGrMiaLomHoEwH8L9mbsrtoELI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-191-K57xygSzMzm_0lK3RSXoQw-1; Wed, 25 Nov 2020 13:47:27 -0500 X-MC-Unique: K57xygSzMzm_0lK3RSXoQw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9EEFE1E7C7; Wed, 25 Nov 2020 18:47:25 +0000 (UTC) Received: from mail (ovpn-112-118.rdu2.redhat.com [10.10.112.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 417525D71B; Wed, 25 Nov 2020 18:47:22 +0000 (UTC) Date: Wed, 25 Nov 2020 13:47:21 -0500 From: Andrea Arcangeli To: David Hildenbrand Cc: Mel Gorman , 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: References: <35F8AADA-6CAA-4BD6-A4CF-6F29B3F402A4@redhat.com> <20201125103933.GM3306@suse.de> <5f01bde6-fe31-9b0e-f288-06b82598a8b3@redhat.com> <33612969-92a1-6c49-a2e0-3a95715b1e7f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33612969-92a1-6c49-a2e0-3a95715b1e7f@redhat.com> User-Agent: Mutt/2.0.2 (2020-11-20) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 25, 2020 at 12:41:55PM +0100, David Hildenbrand wrote: > On 25.11.20 12:04, David Hildenbrand wrote: > > On 25.11.20 11:39, Mel Gorman wrote: > >> 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. > > > > I agree within zones - but AFAIU, the issue is reserved memory between > > zones, right? > > Double checking, I was confused. This applies also to memory holes > within zones in x86. Yes this is a memory hole within the DMA32 zone. Still why there should be any difference? As long as a page struct exists it's in a well defined mem_map array which comes for one and only one zoneid/nid combination. So what would be the benefit of treating memory holes within zones or in between zones differently and leave one or the other with a zoneid/nid uninitialized?