From patchwork Thu Sep 13 02:22:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10598659 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 9EC2815E2 for ; Thu, 13 Sep 2018 02:34:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F90C2992E for ; Thu, 13 Sep 2018 02:34:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8348729BB3; Thu, 13 Sep 2018 02:34:24 +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 ED6D82992E for ; Thu, 13 Sep 2018 02:34:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E364B8E0008; Wed, 12 Sep 2018 22:34:22 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D94C88E0001; Wed, 12 Sep 2018 22:34:22 -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 CAD138E0008; Wed, 12 Sep 2018 22:34:22 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by kanga.kvack.org (Postfix) with ESMTP id 8CDC98E0001 for ; Wed, 12 Sep 2018 22:34:22 -0400 (EDT) Received: by mail-pf1-f199.google.com with SMTP id x19-v6so2050107pfh.15 for ; Wed, 12 Sep 2018 19:34:22 -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=WPf7kXWTrpFn60hijjeg30N+TtYAAZa1Kffgvy2CX5I=; b=T7im0ZJXtuZ4ydCe2aPGE438bhEDhIdxhwrQiqcgOLnuj1uFkE3kXYXP0kNtqZ0k/k YrCOZcYiuk6+7024QBTbV3HPJ45Hvps31/gxqR8Xb0N1pG+48qEDMjqmpO2Qdi8gcIp9 kliOUVsXgBPI6idyPBVlyAbYC68sY2/Lv5FIkQvpqBKXJweqWSvO8mSeI2mnUyXR2mF5 P93mW2M8A2xMPrueam5USGp1468Mbz9756pAzDMcgM2oFIJ8uhXjByLwejjO8IyghDvs PTfZiTmGkuaLdbNbjyP/WlDyl7Sy1MRAuidLSGVoV75SmoVZXB5UJPkh4ZGxWT4V3t7F qQkQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.151 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: APzg51A23CCjlqEVVYD/7VajqrMw8cBZYvx5FbbAEUUjXIh0YgZRis7p zMKokWwou0TphgDsksdy/ZGxvlSGiVkbePO+l9CuMgV7SBKE1ENpt2DBNDTTuP1D++CI1o61IMS YgiTanZFMzaACVNVDAdDbFXUVALjBjSNAge5VE224mgsuzm9YJctnaBQ4NiOzdLU56w== X-Received: by 2002:a62:2285:: with SMTP id p5-v6mr5185737pfj.53.1536806062253; Wed, 12 Sep 2018 19:34:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ6VQiXUA76w9H/d/3u2/yJtipIlnbXQBMo5lww1q8fOW95Ofg/Qqq+qc37vr5xV32YTOv3 X-Received: by 2002:a62:2285:: with SMTP id p5-v6mr5185687pfj.53.1536806061267; Wed, 12 Sep 2018 19:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536806061; cv=none; d=google.com; s=arc-20160816; b=CsUm0UNfBmunFRFOzorp3cUvM7e6Cm+iqYS8q5TWg2Axol64vBx6xz4INtoR8NBHFN 7/g9EMpfscolTwhHK+QBv8qbCt6b+OMqAxtrqgjE4XuKBYQaMF+oQ9be+zIRj1cNcFzd DhYJ3Af8OJwTA6/YZP7EzwBCiWhm+JEv3BtJbmZKYWgoYqm2elfId1Au6GNu64ylEK5M YfQhzT+5VrhvtUcoapqELDRLvSzNO9lNdk1JVGiiAxliK2QMvYWgny1jsWQy3+cgzdYy qIBbbvEvTtafq0knQXTVAv9/IBYnNSHCcrv7GBKmV4fgy9WMufCBZB56FdWL5kgiQlP1 tjag== 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=WPf7kXWTrpFn60hijjeg30N+TtYAAZa1Kffgvy2CX5I=; b=zeLzYXxMre1jXlt2qMpTty8PQP/EiAt81QJnO7G0sLme5ru41JpLI9bEoqkba2GDqJ gc08cHKofBdTNnwAcqtJX3r50futiQPCYA8v97DlgwVI+G2wSvWzON1iyO821xfaTMUo iIfoM8tB48kDJ4E6xyEDVfLsle1Hr5zGsKkc/xsaQfSlO61N2xdYUJ6wfnA5n+lrKVvj 0P3Bcs3sacgULRYYW4at5zt4g88lgHCycE35H8RiBV6MxWVHtPcIPoVqzrybGcY1eNv5 gjJKoYkrsmyPckpHs8YH3wDlLQle7kOTGXH28x9yLYlX5l7vvSVKvSh6PYmJWkDZ6Yxz Sn/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.151 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga17.intel.com (mga17.intel.com. [192.55.52.151]) by mx.google.com with ESMTPS id z22-v6si2770634plo.219.2018.09.12.19.34.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 19:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.151 as permitted sender) client-ip=192.55.52.151; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.151 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 fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2018 19:34:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,367,1531810800"; d="scan'208";a="91259184" 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; 12 Sep 2018 19:34:20 -0700 Subject: [PATCH v5 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: Wed, 12 Sep 2018 19:22:38 -0700 Message-ID: <153680535833.453305.11707396784697533207.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <153680531988.453305.8080706591516037706.stgit@dwillia2-desk3.amr.corp.intel.com> References: <153680531988.453305.8080706591516037706.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 c6cab5205b99..1d5a09087275 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