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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,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 92A4FC47257 for ; Sun, 3 May 2020 10:27:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3D4A420721 for ; Sun, 3 May 2020 10:27:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="omO7ng7X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D4A420721 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8C0DB8E0005; Sun, 3 May 2020 06:27:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 84A658E0001; Sun, 3 May 2020 06:27:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6EC0A8E0005; Sun, 3 May 2020 06:27:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id 541788E0001 for ; Sun, 3 May 2020 06:27:45 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0B29F181AEF1A for ; Sun, 3 May 2020 10:27:45 +0000 (UTC) X-FDA: 76775031690.18.swing63_60b63e0482f4a X-HE-Tag: swing63_60b63e0482f4a X-Filterd-Recvd-Size: 3264 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Sun, 3 May 2020 10:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=PXJzVi9DcMYw4QW4HlkLJ29fvHY2Er138s9UOXtJXhI=; b=omO7ng7XHyZIz9nFubKc9pYiQZ S05SCrB8t64Kja5yHvpT7qP4l6LEu/fv0VYEs2RyUt8VdknYDX8ch77ILZ4E8mUk5JX1cjLHPQqza UbY60DWOH6HOlMghoqQsJ2AGOO+Xf8TLjZIZrqPijIRQhDfQkiyppFPpFW8MXNqE59liu9aWhbEuL 6ureWb7UC21n1UE/SjwwrmaC4cOirA4BxsuqJ3KQHuh/VZbHJMTPnmwj04vEvrAsqh5ybOozBAXFE ZX0H4fx9/kK7hVEBtxYUMXm/MdnRAIqaDv4eVTmULYAlfbOLUQeDRMq6BAotbGDCrs97Kl4IOJExW +aKx0+qA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jVBqY-0004UZ-68; Sun, 03 May 2020 10:27:42 +0000 Date: Sun, 3 May 2020 03:27:42 -0700 From: Matthew Wilcox To: linux-fsdevel@vger.kernel.org, fuse-devel , linux-mm , miklos , Gabriel Krisman Bertazi , =?iso-8859-1?Q?Andr=E9?= Almeida Subject: Re: [fuse-devel] fuse: trying to steal weird page Message-ID: <20200503102742.GF29705@bombadil.infradead.org> References: <87a72qtaqk.fsf@vostro.rath.org> <877dxut8q7.fsf@vostro.rath.org> <20200503032613.GE29705@bombadil.infradead.org> <87368hz9vm.fsf@vostro.rath.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87368hz9vm.fsf@vostro.rath.org> 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, 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. Also, page_count() is unstable. 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!