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=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 EB4ECC64E7C for ; Wed, 2 Dec 2020 05:07:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 470A420DD4 for ; Wed, 2 Dec 2020 05:07:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 470A420DD4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 43BC78D0003; Wed, 2 Dec 2020 00:07:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3EDDA8D0002; Wed, 2 Dec 2020 00:07:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2DC778D0003; Wed, 2 Dec 2020 00:07:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id 13EBB8D0002 for ; Wed, 2 Dec 2020 00:07:29 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C87151F08 for ; Wed, 2 Dec 2020 05:07:28 +0000 (UTC) X-FDA: 77547158976.09.pump53_0001252273b0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id B1600180AD811 for ; Wed, 2 Dec 2020 05:07:28 +0000 (UTC) X-HE-Tag: pump53_0001252273b0 X-Filterd-Recvd-Size: 5602 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Dec 2020 05:07:27 +0000 (UTC) Received: by mail-ej1-f51.google.com with SMTP id f23so928614ejt.8 for ; Tue, 01 Dec 2020 21:07:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KwNZsFRA/IYGRcCT2QHYfNwg6PsGCIWZOBcgb5DDj88=; b=gueikS+aDT27nyPzPyzkwYn1k3AuHzdfALOFE07LukUrb2sb/ctSsjJhidsFcEMaCm gYKAbv8txSy41RAkcLddla+GjCPUv3xaJLTF/hg6J7s2OBWVIx4aWZUtuNXolHUgAcOC j4JETcEyYEEloJVXYLbImTzYYPV3CS0B27bycb5eE8HFygnMwcbqZuW3uCZ9L17k2JDQ gPt5CX/HOx09bJvyYwA4cipDB96S+/og5gEdJcu16JoTXuCiFjR6t7B/YXqIw/4CMU4K Bey6XI70dVU7zez0+E1OoBhRYwm1q4Ida/9ZI5c+606mM8Fm5WcSQogYwlT3hEVg/vMt ncNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KwNZsFRA/IYGRcCT2QHYfNwg6PsGCIWZOBcgb5DDj88=; b=CrdYuHuQ/yLpIwbve1Gj+fpr1/fx2vxanfj/GtgtJuEo+UnE7EjfPE5ckkBSpmJKH3 WRbIWyhT3RlQF3aNOxQPoFBVj2n4NO72RhvvrYq8Mqj5LyA4+C8F+REHfuqsNh3HZi5B 7j8jISlrCEvOxbnWAU1s/m24LeZrv7vtJNcjoHxdpptCplGbY0ORuRKXv0NJzxsoIQWK aIiou+AZxOh6T/MS7U2JpAwFWRNgHi3VW2BRq7s0PlWpObiKjl4NUNfcU1LAiPVt+gqy yNmHPUtJ5AG6yi99xWrI45AAB/rvqKv18HeipXYvciMnvzAaoKLdqT4hAuwxAmqGVaHO av6Q== X-Gm-Message-State: AOAM532sNpXpDFIwgA5VgyfUuvTq4ieRNf/09a4c6eVu078Z8X2Saode c9uKUUy1K4gkA35T6CF1P8E77qYll6lIhwK1yNnTSg== X-Google-Smtp-Source: ABdhPJwxvS7rb7CChYsxSarjfQNmQlqikNgrYtFAORWl/FJzy4zu8qlhsn1pLIhxzClr1QxUZ5ykdF9PH/vyWHnxS5A= X-Received: by 2002:a17:906:c51:: with SMTP id t17mr679087ejf.523.1606885645772; Tue, 01 Dec 2020 21:07:25 -0800 (PST) MIME-Version: 1.0 References: <20201201022412.GG4327@casper.infradead.org> <20201201204900.GC11935@casper.infradead.org> <20201202034308.GD11935@casper.infradead.org> In-Reply-To: <20201202034308.GD11935@casper.infradead.org> From: Dan Williams Date: Tue, 1 Dec 2020 21:07:22 -0800 Message-ID: Subject: Re: mapcount corruption regression To: Matthew Wilcox Cc: "Shutemov, Kirill" , Linux Kernel Mailing List , Linux MM , linux-nvdimm , Vlastimil Babka , Yi Zhang Content-Type: text/plain; charset="UTF-8" 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: On Tue, Dec 1, 2020 at 7:43 PM Matthew Wilcox wrote: > > On Tue, Dec 01, 2020 at 06:28:45PM -0800, Dan Williams wrote: > > On Tue, Dec 1, 2020 at 12:49 PM Matthew Wilcox wrote: > > > > > > On Tue, Dec 01, 2020 at 12:42:39PM -0800, Dan Williams wrote: > > > > On Mon, Nov 30, 2020 at 6:24 PM Matthew Wilcox wrote: > > > > > > > > > > On Mon, Nov 30, 2020 at 05:20:25PM -0800, Dan Williams wrote: > > > > > > Kirill, Willy, compound page experts, > > > > > > > > > > > > I am seeking some debug ideas about the following splat: > > > > > > > > > > > > BUG: Bad page state in process lt-pmem-ns pfn:121a12 > > > > > > page:0000000051ef73f7 refcount:0 mapcount:-1024 > > > > > > mapping:0000000000000000 index:0x0 pfn:0x121a12 > > > > > > > > > > Mapcount of -1024 is the signature of: > > > > > > > > > > #define PG_guard 0x00000400 > > > > > > > > Oh, thanks for that. I overlooked how mapcount is overloaded. Although > > > > in v5.10-rc4 that value is: > > > > > > > > #define PG_table 0x00000400 > > > > > > Ah, I was looking at -next, where Roman renumbered it. > > > > > > I know UML had a problem where it was not clearing PG_table, but you > > > seem to be running on bare metal. SuperH did too, but again, you're > > > not using SuperH. > > > > > > > > > > > > > (the bits are inverted, so this turns into 0xfffffbff which is reported > > > > > as -1024) > > > > > > > > > > I assume you have debug_pagealloc enabled? > > > > > > > > Added it, but no extra spew. I'll dig a bit more on how PG_table is > > > > not being cleared in this case. > > > > > > I only asked about debug_pagealloc because that sets PG_guard. Since > > > the problem is actually PG_table, it's not relevant. > > > > As a shot in the dark I reverted: > > > > b2b29d6d0119 mm: account PMD tables like PTE tables > > > > ...and the test passed. > > That's not really surprising ... you're still freeing PMD tables without > calling the destructor, which means that you're leaking ptlocks on > configs that can't embed the ptlock in the struct page. Ok, so potentially this new tracking is highlighting a long standing bug that was previously silent. That would explain the ambiguous bisect results. > I suppose it shows that you're leaking a PMD table rather than a PTE > table, so that might help track it down. Checking for PG_table in > free_unref_page() and calling show_stack() will probably help more. Will do.