Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4856681pjb; Mon, 27 Jul 2020 06:59:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBmJpRNN5BBGjeXvYLUofHSyh93nJQXbYNTLgx117/zV7afk3yIr5eps9ZMrTBujIMlnYS X-Received: by 2002:aa7:d6cc:: with SMTP id x12mr22099493edr.354.1595858380640; Mon, 27 Jul 2020 06:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595858380; cv=none; d=google.com; s=arc-20160816; b=DLYpAwL1t9nXEiirZYRyTXFxGOUPkmA3Q4mU8mNHeqomkI7Na9VwFffuKATBkAd+AQ vVQ89o+RBe+Vn/foGnCATKTiKrVgLLlP/kfF87kl4T1jtUBVkkcwQ3t4bDzGlL54+lXc QJnlOCW0ru1Ia6dev2//mdGoB3jRoHI7pV9tU7o8RLttYaPxBizuslsMCTIwdS6JziV9 foq+SUaoKPKkjViLF0cLmmBC/GJ25emXP7yETCLMgCR0AVUMYaW9bO5Yp9IOL9jClXsh LBY2Vifkh62pWvXOwb1RP+6b+Qey1w31oWxDvX/6tYVNRW9hGrG7XXA2mPZym1yCgVPK E3Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=w3IFzN3dHxTsM6d1vVVpNI9q/Oauc9/cIxmbJnleAH8=; b=dQhrDz0bgWbjpr27+MGZXT1lLUHm1w8x+tHrmfe3c+6iBMr/IKKnrUakuRDBiXMXPO qb8TWtGJype8BPm/mRKFa9pKwyxv9yvlb7WX2ezoPL4UZ2hcWm4pPllFxJn1BZAGizV3 /74qR19NpHloI6Lz7N+G+uCxmonaSDpd9cFKQ70iBPLBbchIjTJCUbKXCloTztAsT9eu 8haM+wZrplleRNnTfOBxi5W5jliaLz9dUomaYx6qyGrgNHgzyLuR0tiohI4IeInkpTjz 7M0aChpcwvtN+8dy+NZoxoQmC3AE54TXwhSB1wirKZyjVoFo8qQlfrlj73XxkF1wl/MV 3A7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=fKUUcjou; 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 z16si5646193edr.480.2020.07.27.06.59.18; Mon, 27 Jul 2020 06:59:40 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b=fKUUcjou; 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 S1728471AbgG0NpN (ORCPT + 99 others); Mon, 27 Jul 2020 09:45:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728391AbgG0NpM (ORCPT ); Mon, 27 Jul 2020 09:45:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BADB1C061794 for ; Mon, 27 Jul 2020 06:45:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=w3IFzN3dHxTsM6d1vVVpNI9q/Oauc9/cIxmbJnleAH8=; b=fKUUcjouGdOCtKPvq7fa+umPtH Ip3H8UImSDIcUah7UMcMXwJsU6623ygbn3SR/tbDfYEKnPIvQVGYQp9d/Pj+BHHMH/aMYEYZTvmfT Eqi1UnyZnECIU4auCg+Sl3YY3n2qa4V1aAwfAMmh6xPMuLFCO71rRFUFhmPAnGEQPHr06hczZ7SWs y4EeAKJxiAm66IvXqKXGiZuOVg8znkZfbeOsQKZSZYbPIJW+GiuXyWLANjHk5Bibz0Q5jdQFzRLNH vVO2PPip/PxRp9Ev9wb6IJUYK1RTdCY3h+CupiXqDVGF18o5YumL051RB7bresygHWaoOw4GndcJB o/xZQ7Tw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k03Qs-0002Oi-Gr; Mon, 27 Jul 2020 13:44:46 +0000 Date: Mon, 27 Jul 2020 14:44:46 +0100 From: Matthew Wilcox To: Hillf Danton Cc: "Kirill A. Shutemov" , "Kirill A. Shutemov" , Andrew Morton , syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, Mike Kravetz , Johannes Weiner , Jens Axboe , Markus Elfring Subject: Re: kernel BUG at include/linux/swapops.h:LINE! Message-ID: <20200727134446.GL23808@casper.infradead.org> References: <000000000000bc4fd705a6e090e2@google.com> <0000000000004c38cd05aad1d13f@google.com> <20200720165144.93189f7825bd28e234a42cb8@linux-foundation.org> <20200723073744.5268-1-hdanton@sina.com> <20200724111311.rcjqigtjqpkenxg6@box> <20200726164904.GG23808@casper.infradead.org> <20200727103140.xycdx6ctecomqsoe@box> <20200727125950.12048-1-hdanton@sina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727125950.12048-1-hdanton@sina.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 27, 2020 at 08:59:50PM +0800, Hillf Danton wrote: > Can you elaborate on the difference between the two dumps? You didn't trim anything, so I have no idea which two dumps you mean. I'll annotate below ... > > > On Sun, Jul 26, 2020 at 05:49:04PM +0100, Matthew Wilcox wrote: > > > > 1457 086 (20181): drop_caches: 3 > > > > 1457 page:00000000a216ae9a refcount:2 mapcount:0 mapping:000000009ba7bfed index:0x2227 pfn:0x229e7 > > > > 1457 aops:def_blk_aops ino:0 > > > > 1457 flags: 0x4000000000002030(lru|active|private) > > > > 1457 raw: 4000000000002030 fffff5b4416b5a48 fffff5b4408a7988 ffff9e9c34848578 > > > > 1457 raw: 0000000000002227 ffff9e9bd18f0d00 00000002ffffffff 0000000000000000 > > > > 1457 page dumped because: not locked > > > > 1457 swap entry 30.229e7 This is a dump of the page that was found when looking up the migration entry. > On Mon, 27 Jul 2020 13:03:10 +0100 Matthew Wilcox wrote: > > It's not mapped with a PMD. I tweaked my debugging slightly: > > > > static inline swp_entry_t make_migration_entry(struct page *page, int write) > > { > > - BUG_ON(!PageLocked(compound_head(page))); > > + VM_BUG_ON_PAGE(!PageLocked(page), page); > > > > +if (PageHead(page)) dump_page(page, "make entry"); > > +if (PageTail(page)) printk("pfn %lx order %d\n", page_to_pfn(page), thp_order(thp_head(page))); > > > > 1523 page:0000000006f62206 refcount:490 mapcount:1 mapping:0000000000000000 index:0x562b12a00 pfn:0x1dc00 > > 1523 head:0000000006f62206 order:9 compound_mapcount:0 compound_pincount:0 > > 1523 anon flags: 0x400000000009003d(locked|uptodate|dirty|lru|active|head|swapbacked) > > 1523 raw: 400000000009003d ffffecfd41301308 ffffecfd41b08008 ffff9e9971c00059 > > 1523 raw: 0000000562b12a00 0000000000000000 000001ea00000000 0000000000000000 > > 1523 page dumped because: make entry This is dumping the page when we create the entry. For completeness, here's the page that we find from the same run. 1523 page:00000000a18100e6 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x1ddde 1523 flags: 0x4000000000000000() 1523 raw: 4000000000000000 dead000000000100 dead000000000122 0000000000000000 1523 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 1523 page dumped because: not locked (an order-9 page will occupy PFNs 0x1dc00-0x1ddff) It's clearly been freed and is still sitting on the per-CPU free list. I've also seen them as PageBuddy and, as in the first example above, reallocated to a different user.