From patchwork Mon Jul 16 17:01:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10527267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F2FFF601D2 for ; Mon, 16 Jul 2018 17:11:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E214228D80 for ; Mon, 16 Jul 2018 17:11:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5F7C28D83; Mon, 16 Jul 2018 17:11:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 738F428D80 for ; Mon, 16 Jul 2018 17:11:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 325336B0275; Mon, 16 Jul 2018 13:11:14 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2AE336B0276; Mon, 16 Jul 2018 13:11:14 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12C516B0277; Mon, 16 Jul 2018 13:11:14 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by kanga.kvack.org (Postfix) with ESMTP id BF39B6B0275 for ; Mon, 16 Jul 2018 13:11:13 -0400 (EDT) Received: by mail-pg1-f200.google.com with SMTP id x2-v6so3835760pgp.4 for ; Mon, 16 Jul 2018 10:11:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:subject:from :to:cc:date:message-id:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=wUZKv+V5a8+3JW8TGRjM+lABmQ/NSzWnPLW3mmBp1tU=; b=coISuvyL4ktxf/i32BYC9NAGNh7FDLYm4cDqpXyo7NmTuvP/TJlJrNHEVdMfwApbcg tdxNUcRBsdvySkjzcKFs3SlBWSC4xjTux0QdUJQgJhuhKT+KpuuHviEsTeGZxZjTnkCz PL4250Qnm4fW7Mh4cCfz9g/QXHYV4mjCXaF7BAutH/KtP/OZSi4TCtkWVlrMUaOkdRQN GAN8Y+n5v/xLP4co1Kf47ac1KUMCYlOKttiZAIXcI1Oz6mAMMjWU0o7mcNncP0EASaLs xMoYJSpfIvZ2utKladlq0J/k6/Mj0dC3978Q65O6/j0HtS32Cs5xCnJDzo7XDjK2gi/g 3POg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: AOUpUlHU9wkn2gp6uF9HZlwjf/UVhrzwGifC1PJ2dIV6EN+nHVVBhIO7 PLDH//S8Z7tLThR4LQlV3LMOc/ROvQq6eMjQRAiVumIbC+VYaPkiIpW0g9lNiRkyQl1naj+x6Ol pW9HlqBoEgyU2BxEaV0k+7mNhYKdtuss0bmc2B4egDt4RZOIjtDUrKuCLh/O2oB1Gtg== X-Received: by 2002:a63:fd06:: with SMTP id d6-v6mr16481466pgh.348.1531761073461; Mon, 16 Jul 2018 10:11:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcSJsSON1SXvXgxxvkpzKth+gvzTykb6TPwcpRHPKDW0CryjLuCUNw2KDoFUE097FVW5xm0 X-Received: by 2002:a63:fd06:: with SMTP id d6-v6mr16481422pgh.348.1531761072757; Mon, 16 Jul 2018 10:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531761072; cv=none; d=google.com; s=arc-20160816; b=e+RtIcDeYffJo6vENUEl2PlUgmyGQJAeJV0Is33no6pxco1UldOkilVC5FmC3DJVUe TzBCuI/apSc7vUj6OIVJNnY8ujzTdcLbv1R38isegKDRE5wGe43cAcCSkfRuR+aNyOsK 8CyRV2ZO4vEAEReI3wFJeBHAtPHgxkPMqBHloaZuisP5dhWgGlQS367lcurxKu10Yk7V QoDSms9sNGmjvKrEa8mlsoRLdPyQloR1Y6vXhz2192S99qUgMSghpERtvYT3/FtWfYp9 +Z+q5vafnklsvY4VHr+nQHQFfnvuvvome3xiWPy0ffMZ1gWOHJbNQ7t+DSR3GSLqrdsM 5i2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=dRPMZAAatQn2x49X0wojCOgyXfeR5Cf1Tm9IChw6kcnBn5eRdUnzzEbKHHhY23oAKx AIiZ65fruSKob9t9eU91JNrii5LFVC5GuUcbyVyZkdDbnDwm4udKxtwNC+TsxGLtcUFw N8rdy0x8oHlCDXYnnElfJP1qnaqgL1khbl7iQsM7QcpP7sYNh7YF4eHhsqWRH8TBW/WX 7lZFYBfeTFcg6PPHm78MdT16k7Gi2GiQ0SOB8tXIFoEd39sZqMork6S8V1wPLbtmynPD Tv96xpOzR7XTc9ngi3B25abZG/M/B/mzHccEDv8CFMitSr8KqzUpX8fv272CW61q0yuV My/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga04.intel.com (mga04.intel.com. [192.55.52.120]) by mx.google.com with ESMTPS id y34-v6si30665418plb.17.2018.07.16.10.11.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jul 2018 10:11:12 -0700 (PDT) Received-SPF: pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.120 as permitted sender) client-ip=192.55.52.120; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.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 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: X-Virus-Scanned: ClamAV using ClamSMTP 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;