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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE autolearn=unavailable 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 D77D4C48BD1 for ; Wed, 9 Jun 2021 19:24:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0068613F5 for ; Wed, 9 Jun 2021 19:24:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0068613F5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B7DD6EAC1; Wed, 9 Jun 2021 19:24:14 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id 654826EAC1; Wed, 9 Jun 2021 19:24:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UH3lAzOdTh+IWIakCPK1+pjcs9tc455Ii5H0NpMj5HQ=; b=UOr7TeU72onoL1BADvA8sludVR O0O0b/bAG0JaDE3AANqu6LVvKzTyrjkyzKnK7AV4hfgUgCxky0b15Wq22z0cub5XH3UDDpbeV0k1h cl+iY0ZAzjh+Z0q1zAmzBxxKMj4SY6xBc1TWMIlzXkMVXlCj7V6huXkWai0rvBmRiT2ini4+NVIep jSeXlbTZLehdxPApYe2d+Dvo0CP7qEML19dIH18MPzv1na1AA03Ck6hS3A9Wi7nqLe2JCD5+bE3MP 4RH8ZIMezLLC+mmKRDHrNL6g3Ok7ddxb34dlgNGxO2Q4UL2UFbBW+riLGJBNGIaGbxyF3zXA0cpO8 3wN3c47g==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lr3nb-000pwc-KT; Wed, 09 Jun 2021 19:23:38 +0000 Date: Wed, 9 Jun 2021 20:23:35 +0100 From: Matthew Wilcox To: Alex Sierra Subject: Re: [RFC PATCH v2 1/8] ext4/xfs: add page refcount helper Message-ID: References: <20210607204226.7743-1-alex.sierra@amd.com> <20210607204226.7743-2-alex.sierra@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210607204226.7743-2-alex.sierra@amd.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rcampbell@nvidia.com, Felix.Kuehling@amd.com, dri-devel@lists.freedesktop.org, linux-mm@kvack.org, jglisse@redhat.com, amd-gfx@lists.freedesktop.org, jgg@nvidia.com, akpm@linux-foundation.org, hch@lst.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Jun 07, 2021 at 03:42:19PM -0500, Alex Sierra wrote: > +++ b/include/linux/dax.h > @@ -243,6 +243,16 @@ static inline bool dax_mapping(struct address_space *mapping) > return mapping->host && IS_DAX(mapping->host); > } > > +static inline bool dax_layout_is_idle_page(struct page *page) > +{ > + return page_ref_count(page) == 1; > +} We already have something called an idle page, and that's quite a different thing from this. How about dax_page_unused() (it's a use count, so once it's got down to its minimum value, it's unused)?