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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 7B8F5C2D0A8 for ; Sat, 26 Sep 2020 06:35:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DEEA6207F7 for ; Sat, 26 Sep 2020 06:35:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEEA6207F7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 423F76B005C; Sat, 26 Sep 2020 02:35:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3AF4B6B0062; Sat, 26 Sep 2020 02:35:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24F0A8E0001; Sat, 26 Sep 2020 02:35:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0155.hostedemail.com [216.40.44.155]) by kanga.kvack.org (Postfix) with ESMTP id 0B6CB6B005C for ; Sat, 26 Sep 2020 02:35:44 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B13EF824999B for ; Sat, 26 Sep 2020 06:35:43 +0000 (UTC) X-FDA: 77304251766.30.fish24_3d0f13a2716e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 932CD180B3C85 for ; Sat, 26 Sep 2020 06:35:43 +0000 (UTC) X-HE-Tag: fish24_3d0f13a2716e X-Filterd-Recvd-Size: 2398 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Sat, 26 Sep 2020 06:35:43 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 4A4B268AFE; Sat, 26 Sep 2020 08:35:40 +0200 (CEST) Date: Sat, 26 Sep 2020 08:35:39 +0200 From: Christoph Hellwig To: Ralph Campbell Cc: linux-mm@kvack.org, kvm-ppc@vger.kernel.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dan Williams , Ira Weiny , Matthew Wilcox , Jerome Glisse , John Hubbard , Alistair Popple , Christoph Hellwig , Jason Gunthorpe , Bharata B Rao , Zi Yan , "Kirill A . Shutemov" , Yang Shi , Paul Mackerras , Ben Skeggs , Andrew Morton Subject: Re: [PATCH 1/2] ext4/xfs: add page refcount helper Message-ID: <20200926063539.GA3540@lst.de> References: <20200925204442.31348-1-rcampbell@nvidia.com> <20200925204442.31348-2-rcampbell@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200925204442.31348-2-rcampbell@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) 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, Sep 25, 2020 at 01:44:41PM -0700, Ralph Campbell wrote: > error = ___wait_var_event(&page->_refcount, > - atomic_read(&page->_refcount) == 1, > + dax_layout_is_idle_page(page), > TASK_INTERRUPTIBLE, 0, 0, > ext4_wait_dax_page(ei)); > +++ b/fs/xfs/xfs_file.c > @@ -750,7 +750,7 @@ xfs_break_dax_layouts( > > *retry = true; > return ___wait_var_event(&page->_refcount, > - atomic_read(&page->_refcount) == 1, TASK_INTERRUPTIBLE, > + dax_layout_is_idle_page(page), TASK_INTERRUPTIBLE, > 0, 0, xfs_wait_dax_page(inode)); > } I still think a litte helper macro would be nice here: #define dax_wait_page(_inode, _page, _wait_cb) \ ___wait_var_event(&(_page)->_refcount, \ atomic_read(&(_page)->_refcount) == 1, \ TASK_INTERRUPTIBLE, dax_layout_is_idle_page(_page), \ TASK_INTERRUPTIBLE, 0, 0, _wait_cb(_inode));