From patchwork Tue Sep 25 06:15:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10613431 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C40516B1 for ; Tue, 25 Sep 2018 06:27:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CCB529867 for ; Tue, 25 Sep 2018 06:27:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5092E2986A; Tue, 25 Sep 2018 06:27:23 +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=ham 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 C44AE29867 for ; Tue, 25 Sep 2018 06:27:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 72AB18E0065; Tue, 25 Sep 2018 02:27:21 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6D8498E0041; Tue, 25 Sep 2018 02:27:21 -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 5C9D18E0065; Tue, 25 Sep 2018 02:27:21 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by kanga.kvack.org (Postfix) with ESMTP id 204638E0041 for ; Tue, 25 Sep 2018 02:27:21 -0400 (EDT) Received: by mail-pg1-f199.google.com with SMTP id h37-v6so1852778pgh.4 for ; Mon, 24 Sep 2018 23:27:21 -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=4Vmu/25Y8bAQNnVxhdOhVqgYUAzl5CfY55sEgFXvycM=; b=ccYTRA2ZEWXz0HUpQIXD+9wGt4xCasSgrLBMWZ3B+YV1XrVhfFvU21BB0hEwoiD20i aassLnk5sUYWjR345kYta7XWgUSGsgkVTbz9X9BfR10jGzwBz/OWJUoDBq8jeoVd9hjz YTgS2GdujxTko8N6BM4pD3bbW7BBGNccJpP6sGopmAooyNnyv6hZ3biuBD6TFP+/4mDw 9gM/2EMrYkxn0+ssbID9IhAcQEvoz9Czq9P8YeELW1+yefIFukmoHa7gdgepj/hRWllp KtkJDNpN4LciXPAOvDDbdCcRY6JplS7YZxbeEeoKhlJlHHDuVBpLAM90ybasUaOsW4GJ ZtxQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.93 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: ABuFfoi1yxyA5b9kZ9ikwG6VRxUUFEFAQdBzvL7xMuNMGumc5P4Q3b0a 6NkdhEBqwtcnlE53icmyDsQBgmQXrrQDY4vL4RgUxuoTi3Q1El87tuTj8uCJdh5EChs0M3zuw9x IXzSo8yb5OxQjVlIjwmfl1d9DYMIcaECiHSTpul2ijvxms58ELzpYOqnT7xx605hd4A== X-Received: by 2002:a17:902:33c2:: with SMTP id b60-v6mr1044894plc.11.1537856840681; Mon, 24 Sep 2018 23:27:20 -0700 (PDT) X-Google-Smtp-Source: ACcGV608hcNy5jtkM7nyGbyOPyzfTIuS9F0pLJlRgfnGMKOKRjU1uQKmKHMsdKwHp30poQzXRSf4 X-Received: by 2002:a17:902:33c2:: with SMTP id b60-v6mr1044848plc.11.1537856839917; Mon, 24 Sep 2018 23:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537856839; cv=none; d=google.com; s=arc-20160816; b=SK9MSysVz2frjol2NPafGDW0Q2ACrgbRiOI63trQ4BNKspGfliNCvEiyny4JuFAqy/ b+BDN28H0l7jUArariq/fqUmhl+URTj0A1F681Wq1PU+BRetekAZHIWijXb8dK4Nrr/r Nd09kyP7hgdAB42hYt7wZmd8URMl02P7d2muUG1UWpMhyNV5GOVxPsAT5WdNV/X8R4o+ WByw4PSYO4s7dORGMeUmZfo9+YXAnZjcH2Hz8uX7DkNBr9c3EurD6sZ+nD14UczcPabk U/J3IpLdkxI8IXjmh5B154NQj/xIfK8gYg55kV1vdZNLngDjOAF9MzrYIMlCyK33ZNkw p8eQ== 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; bh=4Vmu/25Y8bAQNnVxhdOhVqgYUAzl5CfY55sEgFXvycM=; b=z6bqIBQfr+rs0JW/LN36150M9dMaK5EbUG+z3X7TAXHH/7aOxK+SyAuQhy7M5qKt6K xoSCLk1zKH6oBeaOf/DYikMZafD6iSP59IL12rcKU30SODvv09aX4T99uuAJaI3apdx3 5ROnizD+7Dl9iuu5/tO8FhvJ0aHWuFam4HdpEgv8Ig+4AQmPSUOqUy3gJMiMLgrd0gqR mtJlTjpuNYKJ+YUzzHtkJkexx1qbXEyDFm8Eray8ZlL3K0/4tBmYR5+WrUcvmSY5w6uo Pa3ZetRxy0zPCbcrJMXrmQlVx4qDzqqRSjnizRrjdFpYzcJT1EYo625cSHvVd++8KsuN x2tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.93 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga11.intel.com (mga11.intel.com. [192.55.52.93]) by mx.google.com with ESMTPS id v6-v6si1467279pgo.532.2018.09.24.23.27.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 23:27:19 -0700 (PDT) Received-SPF: pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.93 as permitted sender) client-ip=192.55.52.93; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.93 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 orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2018 23:27:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,301,1534834800"; d="scan'208";a="94557838" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga002.jf.intel.com with ESMTP; 24 Sep 2018 23:27:18 -0700 Subject: [PATCH v6 7/7] mm, hmm: Mark hmm_devmem_{add, add_resource} EXPORT_SYMBOL_GPL From: Dan Williams To: akpm@linux-foundation.org Cc: =?utf-8?b?SsOpcsO0bWU=?= Glisse , Logan Gunthorpe , Christoph Hellwig , alexander.h.duyck@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Mon, 24 Sep 2018 23:15:31 -0700 Message-ID: <153785613162.283091.15536211596081003220.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <153785609460.283091.17422092801700439095.stgit@dwillia2-desk3.amr.corp.intel.com> References: <153785609460.283091.17422092801700439095.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 The routines hmm_devmem_add(), and hmm_devmem_add_resource() duplicated devm_memremap_pages() and are now simple now wrappers around the core facility to inject a dev_pagemap instance into the global pgmap_radix and hook page-idle events. The devm_memremap_pages() interface is base infrastructure for HMM. HMM has more and deeper ties into the kernel memory management implementation than base ZONE_DEVICE which is itself a EXPORT_SYMBOL_GPL facility. Originally, the HMM page structure creation routines copied the devm_memremap_pages() code and reused ZONE_DEVICE. A cleanup to unify the implementations was discussed during the initial review: http://lkml.iu.edu/hypermail/linux/kernel/1701.2/00812.html Recent work to extend devm_memremap_pages() for the peer-to-peer-DMA facility enabled this cleanup to move forward. In addition to the integration with devm_memremap_pages() HMM depends on other GPL-only symbols: mmu_notifier_unregister_no_release percpu_ref region_intersects __class_create It goes further to consume / indirectly expose functionality that is not exported to any other driver: alloc_pages_vma walk_page_range HMM is derived from devm_memremap_pages(), and extends deep core-kernel fundamentals. Similar to devm_memremap_pages(), mark its entry points EXPORT_SYMBOL_GPL(). Cc: "Jérôme Glisse" Cc: Logan Gunthorpe Reviewed-by: Christoph Hellwig Signed-off-by: Dan Williams --- mm/hmm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/hmm.c b/mm/hmm.c index 2e72cb4188ca..90d1383c7e24 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -1062,7 +1062,7 @@ struct hmm_devmem *hmm_devmem_add(const struct hmm_devmem_ops *ops, return result; return devmem; } -EXPORT_SYMBOL(hmm_devmem_add); +EXPORT_SYMBOL_GPL(hmm_devmem_add); struct hmm_devmem *hmm_devmem_add_resource(const struct hmm_devmem_ops *ops, struct device *device, @@ -1116,7 +1116,7 @@ struct hmm_devmem *hmm_devmem_add_resource(const struct hmm_devmem_ops *ops, return result; return devmem; } -EXPORT_SYMBOL(hmm_devmem_add_resource); +EXPORT_SYMBOL_GPL(hmm_devmem_add_resource); /* * A device driver that wants to handle multiple devices memory through a