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.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 9625CC47247 for ; Tue, 5 May 2020 12:43:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5A2C42073B for ; Tue, 5 May 2020 12:43:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aSSGHkbh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A2C42073B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E6C488E00C9; Tue, 5 May 2020 08:43:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E1CB28E00C0; Tue, 5 May 2020 08:43:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D32698E00C9; Tue, 5 May 2020 08:43:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id B84F98E00C0 for ; Tue, 5 May 2020 08:43:29 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4567C181AEF31 for ; Tue, 5 May 2020 12:43:29 +0000 (UTC) X-FDA: 76782631338.05.dress58_589b818a3f961 X-HE-Tag: dress58_589b818a3f961 X-Filterd-Recvd-Size: 4043 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Tue, 5 May 2020 12:43:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588682608; 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=aSSGHkbhPC+QNCmmWxx7M4g2YoMHxaThYywLOvyIGK4TEko1qHar0r2qBxKzqKsoU5yY/h BjB56wbBLtTGzMUvOPnUbVXibdL15TwCxrLdWJt5QOiXnAfeiWHHtPcltuuUMYQAm0SW4K s4JvhyNBRx5WuyAu8K/NfNSb7Sj5XCw= 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 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: 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; } }