Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2335999pxb; Mon, 11 Jan 2021 07:11:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtmIbpyHl6ddKZAKEd0INaRdVyK10+AGjraJvWYM4QXqK7q9FyijCzzZvQk8cax2BMjEZH X-Received: by 2002:a17:906:e291:: with SMTP id gg17mr11264122ejb.31.1610377867886; Mon, 11 Jan 2021 07:11:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610377867; cv=none; d=google.com; s=arc-20160816; b=h1ih/Zb0fQZRmp17tJmTRm/1jk8jgPwZ/+Ou3jLLah2yl8DXYgLPe/fFlteKLXi6wv A8bMJdfk6alj7dNX2u/wLsYVdivSI7y8XQe//GQwRKDj8gnnE0k8tWA+qRrLyiOrcPZ3 NirlMn0tiwGaAW9Dp1cfjCyaBqiEVE/ZLcaF15SbPAc8pFhwh/VYUjpVoBuegHxOvoFm Spgy6vJHoPOgR3RMmnP7qW16/MkGTnCAWMNPJAoquEqBsbvDjqS29gjyIwe3ZMS874mQ 1ySNpakxa9Q2rJW2MQncJOhW8ijSJh2TD6464uVbKstXr8HbvwlONy1J4e2KJmN2/Ylw +oXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=/g7CoqAv3+2DuhrWm4HZxfGTuv3YxRqKxge5jGqMOnw=; b=tNsDpdPdR9kmFlgt161SPeLKKCtAj0nwxfCplGtVQ4U/wrbPwxmtVugjx61KVNrzzl VrDt+ZStMe3kAT9z5VkABiJkeVNA3Fh3/4aBiSXg2SHL/OlJuQ2z9+Fk/XYlNRYsHPPX Q2p5Y+zB17Vm3Xz6oHNm5btxHQwxvctgeD/9eG1GCOZN1t3Agq98zePt0gjDhr5S6rsG npvF5qC2TvnYJi8nNKZqgUAAtImjwF7fIi9yWgORPYQehtMzvMmgGsQgwVqLzT9Y07O2 OocDgiFXt2ghklmlxWrX0e/aVOXleH638sTSozzG6sFVwW8uNyty/X191y0WEZJXp+mD tc4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d95k9JOK; 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 do7si3308508ejc.585.2021.01.11.07.10.43; Mon, 11 Jan 2021 07:11:07 -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=d95k9JOK; 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 S2387760AbhAKPIW (ORCPT + 99 others); Mon, 11 Jan 2021 10:08:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37418 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731426AbhAKPIV (ORCPT ); Mon, 11 Jan 2021 10:08:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610377615; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/g7CoqAv3+2DuhrWm4HZxfGTuv3YxRqKxge5jGqMOnw=; b=d95k9JOKyzP8xpDY79wwZzJ5hh7MxF8Im1NtM3Y/zVNg4qtX9A5fteOhADoMmwzW4rrg1J q6D9fUurIs6FG9/jBMvfXfDN1Hi+ZHJbi//u3ZONpis+4BueRd9ijvdPX0tTT1DPvswJwA V7xqwlpXGwEkXAGq7Ojy/CfNzzK08cI= 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-397-FIhTPNSeNnCUTrXgbggs3Q-1; Mon, 11 Jan 2021 10:06:51 -0500 X-MC-Unique: FIhTPNSeNnCUTrXgbggs3Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 261E715724; Mon, 11 Jan 2021 15:06:49 +0000 (UTC) Received: from ovpn-119-23.rdu2.redhat.com (ovpn-119-23.rdu2.redhat.com [10.10.119.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id A425219C59; Mon, 11 Jan 2021 15:06:43 +0000 (UTC) Message-ID: <782e710eac32b1ab3bf9713bcd6afcbc9483e16c.camel@redhat.com> Subject: Re: [PATCH v2 2/2] mm: fix initialization of struct page for holes in memory layout From: Qian Cai To: Mike Rapoport Cc: Andrew Morton , Andrea Arcangeli , Baoquan He , David Hildenbrand , Mel Gorman , Michal Hocko , Mike Rapoport , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-mm@kvack.org, stable@vger.kernel.org, Stephen Rothwell , Linux Next Mailing List Date: Mon, 11 Jan 2021 10:06:43 -0500 In-Reply-To: <20210110153956.GD1106298@kernel.org> References: <20201209214304.6812-1-rppt@kernel.org> <20201209214304.6812-3-rppt@kernel.org> <768cb57d6ef0989293b3f9fbe0af8e8851723ea1.camel@redhat.com> <20210105082403.GA1106298@kernel.org> <67ef893f27551f80ecf49ef78c0ebc05d3e41b46.camel@redhat.com> <20210106080553.GB1106298@kernel.org> <8171f5a5a8b407a1fcca56bab912555bde80d323.camel@redhat.com> <20210110153956.GD1106298@kernel.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2021-01-10 at 17:39 +0200, Mike Rapoport wrote: > On Wed, Jan 06, 2021 at 04:04:21PM -0500, Qian Cai wrote: > > On Wed, 2021-01-06 at 10:05 +0200, Mike Rapoport wrote: > > > I think we trigger PF_POISONED_CHECK() in PageSlab(), then > > > fffffffffffffffe > > > is "accessed" from VM_BUG_ON_PAGE(). > > > > > > It seems to me that we are not initializing struct pages for holes at the > > > node > > > boundaries because zones are already clamped to exclude those holes. > > > > > > Can you please try to see if the patch below will produce any useful info: > > > > [ 0.000000] init_unavailable_range: spfn: 8c, epfn: 9b, zone: DMA, node: > > 0 > > [ 0.000000] init_unavailable_range: spfn: 1f7be, epfn: 1f9fe, zone: > > DMA32, node: 0 > > [ 0.000000] init_unavailable_range: spfn: 28784, epfn: 288e4, zone: > > DMA32, node: 0 > > [ 0.000000] init_unavailable_range: spfn: 298b9, epfn: 298bd, zone: > > DMA32, node: 0 > > [ 0.000000] init_unavailable_range: spfn: 29923, epfn: 29931, zone: > > DMA32, node: 0 > > [ 0.000000] init_unavailable_range: spfn: 29933, epfn: 29941, zone: > > DMA32, node: 0 > > [ 0.000000] init_unavailable_range: spfn: 29945, epfn: 29946, zone: > > DMA32, node: 0 > > [ 0.000000] init_unavailable_range: spfn: 29ff9, epfn: 2a823, zone: > > DMA32, node: 0 > > [ 0.000000] init_unavailable_range: spfn: 33a23, epfn: 33a53, zone: > > DMA32, node: 0 > > [ 0.000000] init_unavailable_range: spfn: 78000, epfn: 100000, zone: > > DMA32, node: 0 > > ... > > [ 572.222563][ T2302] kpagecount_read: pfn 47f380 is poisoned > ... > > [ 590.570032][ T2302] kpagecount_read: pfn 47ffff is poisoned > > [ 604.268653][ T2302] kpagecount_read: pfn 87ff80 is poisoned > ... > > [ 604.611698][ T2302] kpagecount_read: pfn 87ffbc is poisoned > > [ 617.484205][ T2302] kpagecount_read: pfn c7ff80 is poisoned > ... > > [ 618.212344][ T2302] kpagecount_read: pfn c7ffff is poisoned > > [ 633.134228][ T2302] kpagecount_read: pfn 107ff80 is poisoned > ... > > [ 633.874087][ T2302] kpagecount_read: pfn 107ffff is poisoned > > [ 647.686412][ T2302] kpagecount_read: pfn 147ff80 is poisoned > ... > > [ 648.425548][ T2302] kpagecount_read: pfn 147ffff is poisoned > > [ 663.692630][ T2302] kpagecount_read: pfn 187ff80 is poisoned > ... > > [ 664.432671][ T2302] kpagecount_read: pfn 187ffff is poisoned > > [ 675.462757][ T2302] kpagecount_read: pfn 1c7ff80 is poisoned > ... > > [ 676.202548][ T2302] kpagecount_read: pfn 1c7ffff is poisoned > > [ 687.121605][ T2302] kpagecount_read: pfn 207ff80 is poisoned > ... > > [ 687.860981][ T2302] kpagecount_read: pfn 207ffff is poisoned > > The e820 map has a hole near the end of each node and these holes are not > initialized with init_unavailable_range() after it was interleaved with > memmap initialization because such holes are not accounted by > zone->spanned_pages. > > Yet, I'm still cannot really understand how this never triggered > > VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page); > > before v5.7 as all the struct pages for these holes would have zone=0 and > node=0 ... > > @Qian, can you please boot your system with memblock=debug and share the > logs? > http://people.redhat.com/qcai/memblock.txt