From patchwork Wed Jul 11 05:14:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10518793 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 A82186028E for ; Wed, 11 Jul 2018 05:25:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9954E28DAA for ; Wed, 11 Jul 2018 05:25:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D64B28DC9; Wed, 11 Jul 2018 05:25:42 +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 2435228DAA for ; Wed, 11 Jul 2018 05:25:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 194F16B026F; Wed, 11 Jul 2018 01:25:41 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 142836B0270; Wed, 11 Jul 2018 01:25:41 -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 F26F06B0271; Wed, 11 Jul 2018 01:25:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by kanga.kvack.org (Postfix) with ESMTP id AB88D6B026F for ; Wed, 11 Jul 2018 01:25:40 -0400 (EDT) Received: by mail-pg1-f197.google.com with SMTP id g5-v6so584392pgq.5 for ; Tue, 10 Jul 2018 22:25:40 -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=RmhDrPhZesu8xiag8dlwuI3GSCHAcLV/meI4F6oZ5bU=; b=ZsxgrbfC4nVD/WFMeNuoW2gvFXepaW6eoIXf+/iWnNwRWpqRhncVj+6pM9mIyX/b86 LQtO7c/PacOpjwLDTP1Ru/pyYxnPcGK+IOO/QbSWfpNFdmB4awszGKQh/Fpx1wkJUT/E BjI/laTFDceeVFYApTyhZXBkw4ONQ6Amoaa05FIFXYhFJfKXw9COY5TY7GXBM2ROcVIf 62NXc9bIDC30yo7Ashqwj0LxL5U5CpFejsUIsG5tjv2MVH88h/RTvvJuvRBB8Y5K/QKm lH5+AyO1F+PkxWT8J3xMVHJO5aD1jEL58eNJYShjrT+DjN0b4VrSXUlCNX679j3x1dHr uUwQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.20 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: APt69E0zT4iG7hz0ViY0UFFqEnCqCdaWkWHwv+YE/OulC9+OT+mEPwP6 xwqeGnVv4N4LNvOPV8ezBwA2QAdCzbetodRv8yUT7ikDJo0FMu2INmOwdsTWkkhlndstRaZHLbo Q9BD9xqwuhyxY6/AcuWsY+ZZRLuvoLcJtUxBDx9ou8z00CJ8ZresejKp3ljSJzzuI6Q== X-Received: by 2002:a17:902:6b0b:: with SMTP id o11-v6mr5541252plk.101.1531286740393; Tue, 10 Jul 2018 22:25:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpem7l1+Cj0VPJjfREfp7h8qmToCZ3R+13p9tmNI6Oi48XArm9x9hK7mKB5GxSnSTk+mZtb9 X-Received: by 2002:a17:902:6b0b:: with SMTP id o11-v6mr5541224plk.101.1531286739650; Tue, 10 Jul 2018 22:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531286739; cv=none; d=google.com; s=arc-20160816; b=u1abmYuroirKDHIjM1Pgh7iGjMN4wx9670YVYZgg0F4zFRkNFPNEE5XUly1h3LRqSI issVr+Kkpx1QNfajkYWP+MTN8g0BVB7DWFGjK4OAYf+M7nTMsniOxbVGizpOOZU336w5 ghGbr0WzNHr/4qDoYFDzD19P1k04F9MflbSP9plaJE34bkz3pqsWwT2cktmdT8vJG9Ve JW3zDsRO0KVdwetSkWeLh3iCMt/KLki51oBD62vVumGrfQgyL1iIokajNlwhPzQ34rqs 77MeN8bI/oMSRNSqOfkVtcN5NFIxconFYGaEa9sn9cB/gVlmCVC8KwswQiX6jDzbJ9xZ GPQw== 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=RmhDrPhZesu8xiag8dlwuI3GSCHAcLV/meI4F6oZ5bU=; b=M6QEex9G0yQRdJ3c8UrL1pQY6COVoNDQgLYU9Ti8NfkEEfxARrqOAgp4TD7x/RlN8e 2a+R3du8zal/iX58SRJMe6u5IrMiY8CKJnYgM3xVwdLPckLd05pIknBO9buQdp6FFChr TSrNJDWKNu/TnkRlNQiPsxctuvIWHqSluhrQZQgRBHt4svBSYysY7Pese8r5ZYJNtcZn ENPPNPx12956elrzAq+nqvaEbTMwaRTQjnzjlf7pVRkDRsIeRSxEeMtHyGHeLg9ij1/b oQDZ/7bja29FxghnvkrYKjykvtvU9dmlP74ZxiGFmbuRobRObaqAaxFEx2iu/f6uDKA1 U6uQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga02.intel.com (mga02.intel.com. [134.134.136.20]) by mx.google.com with ESMTPS id t4-v6si18057528plo.235.2018.07.10.22.25.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jul 2018 22:25:39 -0700 (PDT) Received-SPF: pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.20 as permitted sender) client-ip=134.134.136.20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.20 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 orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2018 22:25:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,337,1526367600"; d="scan'208";a="66016508" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga003.jf.intel.com with ESMTP; 10 Jul 2018 22:24:40 -0700 Subject: [PATCH v4 1/8] mm, devm_memremap_pages: Mark devm_memremap_pages() EXPORT_SYMBOL_GPL From: Dan Williams To: akpm@linux-foundation.org Cc: Michal Hocko , =?utf-8?b?SsOpcsO0bWU=?= Glisse , Christoph Hellwig , linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Tue, 10 Jul 2018 22:14:42 -0700 Message-ID: <153128608284.2928.17076051301321355622.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <153128607743.2928.4465435789810433432.stgit@dwillia2-desk3.amr.corp.intel.com> References: <153128607743.2928.4465435789810433432.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 devm_memremap_pages() facility is tightly integrated with the kernel's memory hotplug functionality. It injects an altmap argument deep into the architecture specific vmemmap implementation to allow allocating from specific reserved pages, and it has Linux specific assumptions about page structure reference counting relative to get_user_pages() and get_user_pages_fast(). It was an oversight that this was not marked EXPORT_SYMBOL_GPL from the outset. It exposes and relies upon core kernel internal assumptions and will continue to evolve as memory hotplug and support for new memory types and topologies is required. Only an in kernel GPL-only driver is expected to keep up with this ongoing evolution. Cc: Michal Hocko Cc: "Jérôme Glisse" Reviewed-by: Christoph Hellwig Signed-off-by: Dan Williams --- kernel/memremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/memremap.c b/kernel/memremap.c index 5857267a4af5..4478e4688bb7 100644 --- a/kernel/memremap.c +++ b/kernel/memremap.c @@ -257,7 +257,7 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap) pgmap_radix_release(res, pgoff); return ERR_PTR(error); } -EXPORT_SYMBOL(devm_memremap_pages); +EXPORT_SYMBOL_GPL(devm_memremap_pages); unsigned long vmem_altmap_offset(struct vmem_altmap *altmap) {