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=-9.9 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL 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 C35CFC28CBC for ; Sun, 3 May 2020 21:34:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 58B83206EB for ; Sun, 3 May 2020 21:34:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qSOkuJHD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58B83206EB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B88BF8E0005; Sun, 3 May 2020 17:34:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B394D8E0001; Sun, 3 May 2020 17:34:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A76A78E0005; Sun, 3 May 2020 17:34:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0196.hostedemail.com [216.40.44.196]) by kanga.kvack.org (Postfix) with ESMTP id 913288E0001 for ; Sun, 3 May 2020 17:34:56 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 444FF181AEF31 for ; Sun, 3 May 2020 21:34:56 +0000 (UTC) X-FDA: 76776712992.23.toes46_654942e21a308 X-HE-Tag: toes46_654942e21a308 X-Filterd-Recvd-Size: 5302 Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Sun, 3 May 2020 21:34:55 +0000 (UTC) Received: by mail-oo1-f53.google.com with SMTP id b17so1971502ooa.0 for ; Sun, 03 May 2020 14:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=IgTeF+LVkrmnHGOkyt/OzpDEYF5QYc9hbEmPaYioyu0=; b=qSOkuJHDBtR/oPMjvTGnHm5RKzGT0BPqeqGc8PygnC+CxUQh1J/V27Lt+QCrnJeGYz VTCSSMWuPLtKkQgYnI0C1CUkFO7RPiCcq/KFyt1yMS/sTaCLx4zxHC4qMNoq8cOa9PmI iSeRyh5SzK7IEgxPoQYk+7zNivYvvZbLTTkFkuz/FcaAcWzMPAa8LcRTPuV+sZ2RPDoS wkSQa96IfVrbw/gingwHEyBxmaRZEAfVdLbhO7tGs5YkOhH/wTgw/F5kkl9D8RYw5AVY sqAT7QT4JNol1CDs1oB/mHabGch4Ay+XG8txQ5ePb3PClxCECdMB/NrBleSrY6RH9UWn 5AYQ== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=IgTeF+LVkrmnHGOkyt/OzpDEYF5QYc9hbEmPaYioyu0=; b=hnifMvlWa3q/+UxVKLMS4h4wh9W3dyLW3M/93LExkIt2ila9WPZMAjsNeI9xwhbBVz 37zJX5kPismh+z2X/DFQqWSDle/mbjDL+E8pu4A6hgHMrZWEpnYAJ5zPVqqetjrlXT72 SVMnZa2DNa3RmwX/sp9g4cTQxGBgSe6MVy5dv/Jk71BHXb7k7uYtcEtiK8YGIjS74zFD ewAEca9jXKW3XtF1MJyoby8iD47qozTRtAtY1B9QSf+kBw/eBTBNS8d0UU2SOyPXaZ1H 5O7kueAIWeakMlW/o8FElRajh0aTzDPC/jJJTYbgGAMymeb649EQYrIxa/mZq+DYYsZu Ij+Q== X-Gm-Message-State: AGi0PuZxQaBRrS9FkXM9gN7ypQM9W8GfqtCHvgGOnR7sBbg+rlClrVtu bV0Y/Rfgn36NC7+ZRjjQXjZToA== X-Google-Smtp-Source: APiQypIhrXkS38NaBOw0Ubh4BR6oaPPy8n2CZ8sy6uuHzXloQ+3ERxcPAvt2P2jIBybO3uvRtqnhRQ== X-Received: by 2002:a4a:274f:: with SMTP id w15mr5041010oow.93.1588541694956; Sun, 03 May 2020 14:34:54 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id 80sm2693094otd.35.2020.05.03.14.34.53 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Sun, 03 May 2020 14:34:54 -0700 (PDT) Date: Sun, 3 May 2020 14:34:39 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Matthew Wilcox cc: linux-fsdevel@vger.kernel.org, fuse-devel , linux-mm , miklos , Gabriel Krisman Bertazi , Andre Almeida Subject: Re: [fuse-devel] fuse: trying to steal weird page In-Reply-To: <20200503102742.GF29705@bombadil.infradead.org> Message-ID: References: <87a72qtaqk.fsf@vostro.rath.org> <877dxut8q7.fsf@vostro.rath.org> <20200503032613.GE29705@bombadil.infradead.org> <87368hz9vm.fsf@vostro.rath.org> <20200503102742.GF29705@bombadil.infradead.org> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Sun, 3 May 2020, Matthew Wilcox wrote: > On Sun, May 03, 2020 at 09:43:41AM +0100, Nikolaus Rath wrote: > > Here's what I got: > > > > [ 221.277260] page:ffffec4bbd639880 refcount:1 mapcount:0 mapping:0000000000000000 index:0xd9 > > [ 221.277265] flags: 0x17ffffc0000097(locked|waiters|referenced|uptodate|lru) > > [ 221.277269] raw: 0017ffffc0000097 ffffec4bbd62f048 ffffec4bbd619308 0000000000000000 > > [ 221.277271] raw: 00000000000000d9 0000000000000000 00000001ffffffff ffff9aec11beb000 > > [ 221.277272] page dumped because: fuse: trying to steal weird page > > [ 221.277273] page->mem_cgroup:ffff9aec11beb000 > > Great! Here's the condition: > > if (page_mapcount(page) || > page->mapping != NULL || > page_count(page) != 1 || > (page->flags & PAGE_FLAGS_CHECK_AT_PREP & > ~(1 << PG_locked | > 1 << PG_referenced | > 1 << PG_uptodate | > 1 << PG_lru | > 1 << PG_active | > 1 << PG_reclaim))) { > > mapcount is 0, mapping is NULL, refcount is 1, so that's all fine. > flags has 'waiters' set, which is not in the allowed list. I don't > know the internals of FUSE, so I don't know why that is. That list of PG_flags dates back to 2010: which 2016's 62906027091f ("mm: add PageWaiters indicating tasks are waiting for a page bit") ought to have updated. Though it's understandable that it did not: surprising to find a list of PG_flags outside of mm/ and fs/proc/. Just add PG_waiters to the list and the issue should go away. > > Also, page_count() is unstable. Agreed: fine to back out if page_count() is high, but not good to issue a worrying warning about it. > Unless there has been an RCU grace period > between when the page was freed and now, a speculative reference may exist > from the page cache. So I would say this is a bad thing to check for. > > Thanks for the swift provision of the debugging data!