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=-2.3 required=3.0 tests=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 98753C10F27 for ; Tue, 10 Mar 2020 15:19:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B50D20873 for ; Tue, 10 Mar 2020 15:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726436AbgCJPTI (ORCPT ); Tue, 10 Mar 2020 11:19:08 -0400 Received: from mga01.intel.com ([192.55.52.88]:33159 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726316AbgCJPTI (ORCPT ); Tue, 10 Mar 2020 11:19:08 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2020 08:19:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,537,1574150400"; d="scan'208";a="234378139" Received: from iweiny-desk2.sc.intel.com ([10.3.52.147]) by fmsmga007.fm.intel.com with ESMTP; 10 Mar 2020 08:19:07 -0700 Date: Tue, 10 Mar 2020 08:19:07 -0700 From: Ira Weiny To: Vivek Goyal Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, virtio-fs@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, mst@redhat.com Subject: Re: [PATCH 02/20] dax: Create a range version of dax_layout_busy_page() Message-ID: <20200310151906.GA670549@iweiny-DESK2.sc.intel.com> References: <20200304165845.3081-1-vgoyal@redhat.com> <20200304165845.3081-3-vgoyal@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200304165845.3081-3-vgoyal@redhat.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Mar 04, 2020 at 11:58:27AM -0500, Vivek Goyal wrote: > > + /* If end == 0, all pages from start to till end of file */ > + if (!end) { > + end_idx = ULONG_MAX; > + len = 0; I find this a bit odd to specify end == 0 for ULONG_MAX... > } > +EXPORT_SYMBOL_GPL(dax_layout_busy_page_range); > + > +/** > + * dax_layout_busy_page - find first pinned page in @mapping > + * @mapping: address space to scan for a page with ref count > 1 > + * > + * DAX requires ZONE_DEVICE mapped pages. These pages are never > + * 'onlined' to the page allocator so they are considered idle when > + * page->count == 1. A filesystem uses this interface to determine if > + * any page in the mapping is busy, i.e. for DMA, or other > + * get_user_pages() usages. > + * > + * It is expected that the filesystem is holding locks to block the > + * establishment of new mappings in this address_space. I.e. it expects > + * to be able to run unmap_mapping_range() and subsequently not race > + * mapping_mapped() becoming true. > + */ > +struct page *dax_layout_busy_page(struct address_space *mapping) > +{ > + return dax_layout_busy_page_range(mapping, 0, 0); ... other functions I have seen specify ULONG_MAX here. Which IMO makes this call site more clear. Ira