Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1047475ybh; Tue, 10 Mar 2020 13:30:47 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs9ezynu1YPaAhVNfVnRx+NJY75BNantHA9M2vjtCsA6IXDRBnOySNgLPENiAWL2aotzERF X-Received: by 2002:a9d:720a:: with SMTP id u10mr6468268otj.177.1583872246917; Tue, 10 Mar 2020 13:30:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583872246; cv=none; d=google.com; s=arc-20160816; b=nYKEd18XvFdx/tMInvfPlncnlK16b8DD6O9RCbrtRFKqERGeZVkDLA1yzPeetCr+ni ShBiEjbPqZ8t3SvwYVdr8nWN2owz1VI8kCrWO9eCn24ea+S9ydAJPtsgh+xr0VgMYE+a 97hqjFUrjwtYMrK535chRB+hQBCiRttp9gHMJierKIZROAboL05nZNaD1jJTxOV/xGVd wu15+Ez5BTwnFWqkzW17X3nyOw1afke3BaAy7vHec1ysPeNX2VUXc3RFzb9E0t/bvF0W 7YTX9yfiwTcXfFZlgP26TaohVCls/p7VjMOUm9s9H7dYYQbkNmyCy8YRw9/q/ndE7Vyi jEqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0k5j5BAO6+j561EWRZLgyRnG3Sw+2DCMIk63U5xiOW4=; b=rwq6+txtyNM1jTMUoF7uHa228mkgOy2FEv8MfUm1gmde13wN4gGL4l88se59E91Znk g92PbXlxYoj+w1KuQApNUnLfMpsDwVRi7Lbnn4bg8Xdw7Cuz+GvLl18k/pczHf/WHMKf i54tUCJVudWlzgLWjAQkEP9tffnpdGZyghtKh4cWB4XnufLIra2CRVMNZiAYlRcuy3Je heFQ6INrCQLBhRc7ukEJdQl3uuLVwkaGNLjZaO29+sYtnAD1MwuwdDieVsYyBdkF9Nf/ CJm76bo8/NNQ8PS0ORLlImeN8+8UM5GRHAWfm7A5LO6JGkeotnihkUyEw8S5cH2ox5rz zSOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Nu7DPCsG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23si348406oic.171.2020.03.10.13.30.34; Tue, 10 Mar 2020 13:30:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Nu7DPCsG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbgCJU37 (ORCPT + 99 others); Tue, 10 Mar 2020 16:29:59 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:38392 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726307AbgCJU37 (ORCPT ); Tue, 10 Mar 2020 16:29:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583872198; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0k5j5BAO6+j561EWRZLgyRnG3Sw+2DCMIk63U5xiOW4=; b=Nu7DPCsGkvNerfeeAtIqUYusdDVdROxNqplz7/tzu9m4o5FhQ8FJnADV8D256iOu/WJ7fK UurcRsELkafDhnaUFYcznaxkd0bc5Zd5D1wZE1QAVfw3nWe0DlGhycVQqREKVfjgqb7Klz A9b7Q2TMkiHF6GTauAJIOMcmgh/AoFk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-313-w0BHEEh_N8eJI055Y3zOFQ-1; Tue, 10 Mar 2020 16:29:56 -0400 X-MC-Unique: w0BHEEh_N8eJI055Y3zOFQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 464561005514; Tue, 10 Mar 2020 20:29:55 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA87A1001DC2; Tue, 10 Mar 2020 20:29:46 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 7345D22021D; Tue, 10 Mar 2020 16:29:46 -0400 (EDT) Date: Tue, 10 Mar 2020 16:29:46 -0400 From: Vivek Goyal To: Ira Weiny 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: <20200310202946.GE38440@redhat.com> References: <20200304165845.3081-1-vgoyal@redhat.com> <20200304165845.3081-3-vgoyal@redhat.com> <20200310151906.GA670549@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200310151906.GA670549@iweiny-DESK2.sc.intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2020 at 08:19:07AM -0700, Ira Weiny wrote: > 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. I think I looked at unmap_mapping_range() where holelen=0 implies till the end of file and followed same pattern. But I agree that LLONG_MAX (end is of type loff_t) is probably more intuitive. I will change it. Vivek