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.9 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 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 7A11AC2BB55 for ; Fri, 10 Apr 2020 18:15:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 41E6E2082D for ; Fri, 10 Apr 2020 18:15:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EB2DQ91w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41E6E2082D 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 C92298E004C; Fri, 10 Apr 2020 14:14:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C417F8E0003; Fri, 10 Apr 2020 14:14:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B09C58E004C; Fri, 10 Apr 2020 14:14:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 95DB48E0003 for ; Fri, 10 Apr 2020 14:14:59 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 509106C3B for ; Fri, 10 Apr 2020 18:14:59 +0000 (UTC) X-FDA: 76692746718.17.prose14_489bc0a19e534 X-HE-Tag: prose14_489bc0a19e534 X-Filterd-Recvd-Size: 6006 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Apr 2020 18:14:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586542498; 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=fxyCg4PNMupGLPkLDykjmAKda5J4g8JHqfXm772rd2g=; b=EB2DQ91w34x7GnFvQgcFOo2izcjy3rwFpXVjEuJhG9eaJTIszaKhLQOB7/9IfwH+TX7xXu YEkRpsQxq+3ccFq/1s0jP1zK2k2m5x5t8D3XS7XFarbXK/+qvwTa+Dmq/UMNAyOwkeCYWg NMWznNlHdRUCsHgKL93ZJ1VMiDqrjOk= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-156-ofofo096O-GHXikVGkDjsg-1; Fri, 10 Apr 2020 14:14:55 -0400 X-MC-Unique: ofofo096O-GHXikVGkDjsg-1 Received: by mail-qv1-f70.google.com with SMTP id a7so2225562qvm.21 for ; Fri, 10 Apr 2020 11:14:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=t4jnBv56iJyBMaSdpfyq8JNe1NXVm+rxJaqyJqBMPzM=; b=dCY2t3Ks7jhg2xZ/7Owrf8y0EJC7mq2AYmuQNWt+k0qHlQ+RlQW9Kabc3cDf1Z8Nje n8e3LRTAadQc2yOVRl4z9R9v4jV7moVlMoWazmFILER0HA724oKvCfAuv8cQkA6gmyew toVzQOa5d6ikWCZTwmKIj/UCBjdJ1ELzd5qSGr8s2UEYHji3mjtPUNi64LuXxEDLxPDI J0ndtnDETvsvVsajpNTQ+YmRtfbDmTcJVHy6zsowADm6iG909fMlC28pjcA10AnfFWrV Ec9OhHBH2cyAE1RUbfcDuBlTUZmVunSob0ThPiIbSz/2HzzZUhzwMsJxjCnzh3Hz3bf6 Vbgg== X-Gm-Message-State: AGi0PuYxxqik1KyeksPwwURDBjA/HTmre7gBnQcF7+ShRa8qb6nvodng qCoZ5tDcKIMSwS8yZ/tbiup0N4R/Vz61ZxSNLeqJU45NnCYsJnEZdUhTHgx2O3R/GD5BnEzs9Sv hJ8U8V0pk01g= X-Received: by 2002:ac8:4e8e:: with SMTP id 14mr439599qtp.3.1586542495031; Fri, 10 Apr 2020 11:14:55 -0700 (PDT) X-Google-Smtp-Source: APiQypJdgNanx+iC1lJjnr/30Tw/VOyto9B36vj31bco1lYF5s/fzOgTxlfQtzsH9iXspsf0I8lCcQ== X-Received: by 2002:ac8:4e8e:: with SMTP id 14mr439561qtp.3.1586542494668; Fri, 10 Apr 2020 11:14:54 -0700 (PDT) Received: from xz-x1 ([2607:9880:19c0:32::2]) by smtp.gmail.com with ESMTPSA id r6sm2130349qtp.61.2020.04.10.11.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 11:14:53 -0700 (PDT) Date: Fri, 10 Apr 2020 14:14:52 -0400 From: Peter Xu To: Matthew Wilcox Cc: Hillf Danton , kernel test robot , Andrew Morton , Linux Memory Management List , 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 Message-ID: <20200410181452.GC3172@xz-x1> References: <20200410002518.GG8179@shao2-debian> <20200410073209.11164-1-hdanton@sina.com> <20200410153234.GB3172@xz-x1> <20200410153805.GA21484@bombadil.infradead.org> MIME-Version: 1.0 In-Reply-To: <20200410153805.GA21484@bombadil.infradead.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 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. >=20 > 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=3Dy CONFIG_MEMORY_FAILURE=3Dy CONFIG_DEVICE_PRIVATE=3Dn And even a reproducer. However the reproducer script will fail at wget, until I fixed it using: initrd=3Dopenwrt-trinity-i386.cgz to replace: initrd=3Dopenwrt-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_st= ruct *vma, pmd_t *pmd, newpte =3D pte_swp_clear_uffd_wp(newpte); =20 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++; } --=20 Peter Xu