From: Peter Xu <peterx@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Hillf Danton <hdanton@sina.com>,
kernel test robot <lkp@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
linux-kernel@vger.kernel.org
Subject: Re: f45ec5ff16 ("userfaultfd: wp: support swap and page migration"): [ 140.777858] BUG: Bad rss-counter state mm:b278fc66 type:MM_ANONPAGES val:1
Date: Fri, 10 Apr 2020 14:14:52 -0400 [thread overview]
Message-ID: <20200410181452.GC3172@xz-x1> (raw)
In-Reply-To: <20200410153805.GA21484@bombadil.infradead.org>
On Fri, Apr 10, 2020 at 08:38:05AM -0700, Matthew Wilcox wrote:
> On Fri, Apr 10, 2020 at 11:32:34AM -0400, Peter Xu wrote:
> > I'm still trying to digest on what's happened... It would be good too
> > if more information on the test could be given, e.g., what is the
> > behavior of trinity-c2. A reproducer is of course even better.
>
> Trinity is a syscall fuzzer. Don't expect what it's doing to make any
> sense, it's just executing syscalls at random.
OK thanks.
Though I just noticed that the original report is actually with some
attachments which I totally missed initially. There's the config file
showing that we're with:
CONFIG_MIGRATION=y
CONFIG_MEMORY_FAILURE=y
CONFIG_DEVICE_PRIVATE=n
And even a reproducer. However the reproducer script will fail at
wget, until I fixed it using:
initrd=openwrt-trinity-i386.cgz
to replace:
initrd=openwrt-i386-trinity.cgz
Then I can download the initrd and boot the VM with a decent QEMU.
However I didn't see any test running after the VM booted, and it will
reboot/shutdown after 100 sec without any error triggered (I believe
the rc.local tries to run something under /etc/kernel-tests/ but I'm
not sure it's running the right thing).
If there's any way to reproduce (I believe so because it can even
bisect in the original report, I just don't know how...), I'm thinking
maybe we can try to dump every swp entry change that could have been
touched in change_pte_range(), which is the only place that I thought
could be related to this in the commit, to see whether there's
anything suspecious.
8<----------------------------------------------
diff --git a/mm/mprotect.c b/mm/mprotect.c
index 1d823b050329..1b6daf7d03aa 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -173,6 +173,8 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
newpte = pte_swp_clear_uffd_wp(newpte);
if (!pte_same(oldpte, newpte)) {
+ pr_info("%s: Update swp entry, 0x%lx -> 0x%lx\n",
+ __func__, pte_val(oldpte), pte_val(newpte));
set_pte_at(vma->vm_mm, addr, pte, newpte);
pages++;
}
--
Peter Xu
next prev parent reply other threads:[~2020-04-10 18:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-10 0:25 f45ec5ff16 ("userfaultfd: wp: support swap and page migration"): [ 140.777858] BUG: Bad rss-counter state mm:b278fc66 type:MM_ANONPAGES val:1 kernel test robot
2020-04-10 7:32 ` Hillf Danton
2020-04-10 15:32 ` Peter Xu
2020-04-10 15:38 ` Matthew Wilcox
2020-04-10 18:14 ` Peter Xu [this message]
2020-04-11 1:21 ` f45ec5ff16 ("userfaultfd: wp: support swap and page migration"): BUG: Bad rss-counter state Hillf Danton
2020-04-12 12:54 ` f45ec5ff16 ("userfaultfd: wp: support swap and page migration"): [ 140.777858] BUG: Bad rss-counter state mm:b278fc66 type:MM_ANONPAGES val:1 Hillf Danton
2020-04-12 21:45 ` Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200410181452.GC3172@xz-x1 \
--to=peterx@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).