Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2573990imm; Mon, 16 Jul 2018 10:12:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpebXJe0SlyJIU8q7OV3uZwO+lbMv+CRl968sg3hulRE/yFnizPBasmaLcXZP75fOnr4zUpe X-Received: by 2002:a62:4f5b:: with SMTP id d88-v6mr18939242pfb.225.1531761151213; Mon, 16 Jul 2018 10:12:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531761151; cv=none; d=google.com; s=arc-20160816; b=F8meSMinMIO8sF8LjC30TIPc+klqbwz8easzjlDCjYwx76BaGmV1uroBiAzS4uA8hs NMa4ngBvFi3rBY3fqkP7fvR5dee9ezznkwx7ro1K/jWh/5ZWqBrmrRLm29Bw+D2fKjxt x+rpriHLcMYrHZzt92DHX6a2Sku7Uu3xQ9xwwY49eeIDzTVATk9VyvV3ipvOaBZF9Xsw H0MCeaSX1quEyxPUtZ5gGt1sSViE36sAECSNcx+vJqKziz9Oa2hx8K3C87VdHnTbWFO6 PPhKPalMWtbpUYeLiGUUQ/QXR9MxD8tSNACocDkZ4bordpqG9JgJq/AgRbDSfDkMdHX0 ziMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:arc-authentication-results; bh=wUZKv+V5a8+3JW8TGRjM+lABmQ/NSzWnPLW3mmBp1tU=; b=dLfkxyaHm0/X39r9YaDCsDbcXlgjWjr6w9U/i+3Ah40k3u4hUr9TqwwzSW8fYF5IjK fOXd+O81hwGgU8A8rbkYqQc06r5+5jRnrx6HYL64NUe43q2Uw3753PQrHzKkvG4rA6uy frXbzu3UfuhjcmpczWWCcC94qTrmnp6VBbqSF8USlOyGOxiaERcb1GEItDlQABV5kNxn gobhPWNEKElXeA/DGSEJs1eKWHfDtHNVMf8A6CRHVV9FyAGNPAzqI3+X+cmNgUgBpshP ADHckn0b7JEW8DoZ5/YO3hh6lHDtFQPD3BHrGmnL8QZ9sKCCAerEItLNemtd5IwJYuGH nR6g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j33-v6si30783667pld.151.2018.07.16.10.12.16; Mon, 16 Jul 2018 10:12:31 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730302AbeGPRjb (ORCPT + 99 others); Mon, 16 Jul 2018 13:39:31 -0400 Received: from mga01.intel.com ([192.55.52.88]:30103 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728129AbeGPRjb (ORCPT ); Mon, 16 Jul 2018 13:39:31 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2018 10:11:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,362,1526367600"; d="scan'208";a="55423834" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga008.fm.intel.com with ESMTP; 16 Jul 2018 10:11:12 -0700 Subject: [PATCH v2 10/14] filesystem-dax: Do not request a pfn when not required From: Dan Williams To: akpm@linux-foundation.org Cc: Huaisheng Ye , Jan Kara , vishal.l.verma@intel.com, hch@lst.de, linux-mm@kvack.org, jack@suse.cz, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org Date: Mon, 16 Jul 2018 10:01:14 -0700 Message-ID: <153176047420.12695.9821577651771886595.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <153176041838.12695.3365448145295112857.stgit@dwillia2-desk3.amr.corp.intel.com> References: <153176041838.12695.3365448145295112857.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huaisheng Ye Some functions within fs/dax don't need to get pfn from direct_access. In support of allowing memmap initialization to run in the background elide requests for pfns when not required. Signed-off-by: Huaisheng Ye Reviewed-by: Jan Kara Signed-off-by: Dan Williams --- fs/dax.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 641192808bb6..28264ff4e343 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -647,7 +647,6 @@ static int copy_user_dax(struct block_device *bdev, struct dax_device *dax_dev, { void *vto, *kaddr; pgoff_t pgoff; - pfn_t pfn; long rc; int id; @@ -656,7 +655,7 @@ static int copy_user_dax(struct block_device *bdev, struct dax_device *dax_dev, return rc; id = dax_read_lock(); - rc = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), &kaddr, &pfn); + rc = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), &kaddr, NULL); if (rc < 0) { dax_read_unlock(id); return rc; @@ -1052,15 +1051,13 @@ int __dax_zero_page_range(struct block_device *bdev, pgoff_t pgoff; long rc, id; void *kaddr; - pfn_t pfn; rc = bdev_dax_pgoff(bdev, sector, PAGE_SIZE, &pgoff); if (rc) return rc; id = dax_read_lock(); - rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, - &pfn); + rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, NULL); if (rc < 0) { dax_read_unlock(id); return rc; @@ -1116,7 +1113,6 @@ dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data, ssize_t map_len; pgoff_t pgoff; void *kaddr; - pfn_t pfn; if (fatal_signal_pending(current)) { ret = -EINTR; @@ -1128,7 +1124,7 @@ dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data, break; map_len = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), - &kaddr, &pfn); + &kaddr, NULL); if (map_len < 0) { ret = map_len; break;