Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp659942ybj; Tue, 5 May 2020 05:45:13 -0700 (PDT) X-Google-Smtp-Source: APiQypKErDqn5DiL8uS2peNGqG0BBVRozTx8GLQ4R6L5bBTF+NdMj9Qm8vdDuYRR04jN6l0W7KQY X-Received: by 2002:aa7:d6c7:: with SMTP id x7mr2392429edr.313.1588682713680; Tue, 05 May 2020 05:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588682713; cv=none; d=google.com; s=arc-20160816; b=YK5crIGBUQzmx6u9rPWqjWcdtYLTWTsJ0oRNnLaPFOyBoyXOEcyuWvFP/TQfPTNn5e 28v6eIWV6SrK1lcki50fUO6/KpGcDL/bsv+tJwNhQtgJE9lJZi0NNWuvUC5fZbzuoAuC o+HjeNqklye692u7E4j0whQ2esb5b4uWXbdZQ9O22sUo5cQW0e7bcsj7eMHi3yPbUyhw T8vrszRuQTo8Wc5uFhRr1e/c0qsMgYMfhRY2f2svYliGFiRPemvompIj+lxUNfH80dbz 5VxHqI2lPe6K/feGGy4tRiETdf6af1psLM6WcbcQCnaNFU7pdcYX+yL+XoHQA3yZRNPc t2kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:user-agent :in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:dkim-signature; bh=QvblSLfFZRo0c25upM8T9PfnHCbkleHxSvyb57+CDAY=; b=Rwod1z9fs4TCsW4EBqgrX3BSXkWBvX+AzAtQ8qNWayLrci75rvOnSd1dOdpdOscSVl Src2HluScNUwchFm4zR343ulw0yHvsP6wD338UyUu3LK89z8nfSALNtv4WSWcyVIMwV0 Ky+ygOeJxPJHO6J/fqqTapob2X/gF1c6HeqT6T04HJ+MkJtlDzIVA5INO7h/LodPOXMk xnRz51hluvnKtjmTkYQp54Z2seBBElfJgTKiybWmLm6EnKO6ZE6RPuccSp2Lignz+1ql 63VctGUxA3IAMlyAhZxkhw8a9iScuNucORtKfmbGcVG95LQxvLun3qxYtXTrcDyfvIKn rp3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QOqVmkTl; 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 pv20si1095129ejb.295.2020.05.05.05.44.49; Tue, 05 May 2020 05:45:13 -0700 (PDT) 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=QOqVmkTl; 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 S1728934AbgEEMn1 (ORCPT + 99 others); Tue, 5 May 2020 08:43:27 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:50243 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728512AbgEEMn1 (ORCPT ); Tue, 5 May 2020 08:43:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588682606; 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=QvblSLfFZRo0c25upM8T9PfnHCbkleHxSvyb57+CDAY=; b=QOqVmkTlVl9pOFEnJsmwcbOi062aUmQe3mj0IV9gdpktGUgciIsZgd9VIEKHm1nfIU54wd 1b1PGlk73zVKri+3w0JZLadMMRRLovhyKWOdNYUtN9sb2lUzE8WSZ+b7c+R37xFZVs14qQ nsDXgYcyweO86+OWE654Po7xBNKh6Ng= 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-133-IrthXCA0OrWchj2813q8Nw-1; Tue, 05 May 2020 08:43:24 -0400 X-MC-Unique: IrthXCA0OrWchj2813q8Nw-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 076C3872FEA; Tue, 5 May 2020 12:43:22 +0000 (UTC) Received: from localhost (ovpn-12-78.pek2.redhat.com [10.72.12.78]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97E372E025; Tue, 5 May 2020 12:43:17 +0000 (UTC) Date: Tue, 5 May 2020 20:43:14 +0800 From: Baoquan He To: Qian Cai Cc: Mel Gorman , Vlastimil Babka , Michal Hocko , David Hildenbrand , Linux-MM , LKML , Mike Rapoport Subject: Re: compaction: VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn)) Message-ID: <20200505124314.GA5029@MiWiFi-R3L-srv> References: <8C537EB7-85EE-4DCF-943E-3CC0ED0DF56D@lca.pw> <20200424034353.GD4247@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 04/24/20 at 09:45am, Qian Cai wrote: >=20 >=20 > > On Apr 23, 2020, at 11:43 PM, Baoquan He wrote: > >=20 > > On 04/23/20 at 05:25pm, Qian Cai wrote: > >> Compaction starts to crash below on linux-next today. The faulty pag= e belongs to Node 0 DMA32 zone. > >> I=E2=80=99ll continue to narrow it down, but just want to give a hea= dup in case someone could beat me to it. > >>=20 > >> Debug output from free_area_init_core() > >> [ 0.000000] KK start page =3D ffffea0000000040, end page =3D ffff= ea0000040000, nid =3D 0 DMA > >> [ 0.000000] KK start page =3D ffffea0000040000, end page =3D ffff= ea0004000000, nid =3D 0 DMA32 > >> [ 0.000000] KK start page =3D ffffea0004000000, end page =3D ffff= ea0012000000, nid =3D 0 NORMAL > >> [ 0.000000] KK start page =3D ffffea0012000000, end page =3D ffff= ea0021fc0000, nid =3D 4 NORMAL > >=20 > > Where are these printed? They are the direct mapping address of page? >=20 > From this debug patch. Yes, direct mapping. Can you try below patch? I may get why this is caused, not sure if the place is right.=20 diff --git a/mm/compaction.c b/mm/compaction.c index 177c11a8f3b9..e26972f26414 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1409,7 +1409,9 @@ fast_isolate_freepages(struct compact_control *cc) cc->free_pfn =3D highest; } else { if (cc->direct_compaction && pfn_valid(min_pfn)) { - page =3D pfn_to_page(min_pfn); + page =3D pageblock_pfn_to_page(min_pfn, + pageblock_end_pfn(min_pfn), + cc->zone); cc->free_pfn =3D min_pfn; } }