From patchwork Fri Oct 12 17:47:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10639053 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 2CA79157A for ; Fri, 12 Oct 2018 17:59:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D29C2BDA5 for ; Fri, 12 Oct 2018 17:59:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 111922BDA9; Fri, 12 Oct 2018 17:59:29 +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 9089E2BDA5 for ; Fri, 12 Oct 2018 17:59:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B2966B000E; Fri, 12 Oct 2018 13:59:27 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 962186B0269; Fri, 12 Oct 2018 13:59:27 -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 82C6F6B026A; Fri, 12 Oct 2018 13:59:27 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by kanga.kvack.org (Postfix) with ESMTP id 3E69E6B000E for ; Fri, 12 Oct 2018 13:59:27 -0400 (EDT) Received: by mail-pf1-f200.google.com with SMTP id p89-v6so12293496pfj.12 for ; Fri, 12 Oct 2018 10:59:27 -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:user-agent:mime-version :content-transfer-encoding; bh=hZ8Py+vL/PMUUT1Y7f6DHZs6meoVFGuVdWZXvmhVYMc=; b=s2y3on/BndHXluepI8H6VSlgPnHXS/zfaPFhRme7D2yFMHI+WItCtMIl4aHQCWbemT rO/+j5alkn5vKj1zT1/EyJEbYa3ZzmvZMZ5EoF60sjmR7m/ItfLxZEuMGhV1T8FCN7DV SKqucvyFuY8+msglz/AfC2qEicTjFRdcA9qkccr7Xpcx6O+xTdozxwx6V/oYNFcYU05u PardgOADHdTWd8NraZnQ3FEcaeuXpJuvx6LC7Y1AAul5Gcgl1nqK73CXBTc6P6FB3Sky GsuEnQzPGIaCXuGi4xyAGrG+OX7+8OhFHnXEj1KpFvGMzaO0MGG1CFKINQxgtOu+i56X wGtA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.136 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: ABuFfoimdfm3Imu0j3Yeh+DTfkJ9QqWEzrxfnBhE3R/tY5ZyxSF9vyPk IIpOcsmMD2abdCzgPUmBkG13LlI9SsQWCy6hEXUk0q45zYnYN3QgkPBGOdYEdWiIz2N74GvI2BX w+2NI9llFhT/T3o7RG2CW02lk7YIf2iQp8gYelH4Blqrxlo7zHoUQiDvPa2Iar7QbAg== X-Received: by 2002:a62:8f0c:: with SMTP id n12-v6mr7169216pfd.172.1539367166911; Fri, 12 Oct 2018 10:59:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV61VzDrbXTxxkIc+JJo+LDthABrAphY3l9PXIYRvz+YmSV32JApn7aOOXj3WIO6Xrw3AIqBd X-Received: by 2002:a62:8f0c:: with SMTP id n12-v6mr7169188pfd.172.1539367166120; Fri, 12 Oct 2018 10:59:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539367166; cv=none; d=google.com; s=arc-20160816; b=g2nQh6Sx2Lh5v2q/YEwuNXI6JrgL/mMu1AoK2/g+3Y0/nov4bOD3ecWlZugVZ1wzK9 U/mHq6Bmfz3oY1gY7cA5IPFTUvvjtiPeTL2x5AsjlunYWzuobv7eWY3cLzza7PdhogDy IaC3z8fuIrXaNg/MY/gqG1r5lpMybtxappJQwglXmF7GTnJyg4AXhfwncnpB2c8dDacN iQ05/lmRsAOZgZ9XbDiVFs6Luhx0o3NpTf8zz8V7ATxfsoJclDoKt3sgfjFGUGbcIefc huRs/vnesx0D86ptTdTieieaF1MUY1w2dpoxTrsYA1D6179dndOVDVbM30WpbO+Q1OvZ d8RA== 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:message-id:date :cc:to:from:subject; bh=hZ8Py+vL/PMUUT1Y7f6DHZs6meoVFGuVdWZXvmhVYMc=; b=HAlUpVZMzheAaTXq1aopbTEOPdo85q+BVE0OUP6S+YaVCK7hWt9sUEpyjKjdqNw5wM egWqv2ixgTkRrPYPTzGYLBqufbejEk+tFYBVx7IaUcQjgSbuSimMb14KM9df/EdL0D35 OY0ASEtjA1fFPNo6+TyCA6C/+iTv+F/nTf9FCS4K20l341gKcV3Fj7U3MTbOjG2KLbjz 6FV+tmT53eIiSqN3HOcxP4fsvlLG3GIX0sgJhWEoZtWTFywZ2Doida09C7s9ekQxR5aN Ind5ilNagpTNWt8h3VA0MT6KBmABZe7/3b+MHX+3xZfNfcEUaSiL0uEcMNrAI1WCn2Y9 QnBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.136 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga12.intel.com (mga12.intel.com. [192.55.52.136]) by mx.google.com with ESMTPS id d41-v6si1865212pla.172.2018.10.12.10.59.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 10:59:26 -0700 (PDT) Received-SPF: pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.136 as permitted sender) client-ip=192.55.52.136; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 192.55.52.136 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 fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2018 10:59:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,373,1534834800"; d="scan'208";a="97015623" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga004.fm.intel.com with ESMTP; 12 Oct 2018 10:59:25 -0700 Subject: [PATCH v7 0/7] mm: Merge hmm into devm_memremap_pages, mark GPL-only From: Dan Williams To: akpm@linux-foundation.org Cc: stable@vger.kernel.org, Balbir Singh , Logan Gunthorpe , Christoph Hellwig , =?utf-8?b?SsOpcsO0bWU=?= Glisse , Michal Hocko , =?utf-8?b?SsOpcsO0bWU=?= Glisse , linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Fri, 12 Oct 2018 10:47:37 -0700 Message-ID: <153936645715.1197954.17511560935912733744.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 Changes since v6 [1]: * Rebase on next-20181008 and fixup conflicts with the xarray conversion and hotplug optimizations * It has soaked on a 0day visible branch for a few days without any reports. [1]: https://lkml.org/lkml/2018/9/13/104 --- Hi Andrew, Jérôme has reviewed the cleanups, thanks Jérôme. We still disagree on the EXPORT_SYMBOL_GPL status of the core HMM implementation, but Logan, Christoph and I continue to support marking all devm_memremap_pages() derivatives EXPORT_SYMBOL_GPL. HMM has been upstream for over a year, with no in-tree users it is clear it was designed first and foremost for out of tree drivers. It takes advantage of a facility Christoph and I spearheaded to support persistent memory. It continues to see expanding use cases with no clear end date when it will stop attracting features / revisions. It is not suitable to export devm_memremap_pages() as a stable 3rd party driver api. devm_memremap_pages() is a facility that can create struct page entries for any arbitrary range and give out-of-tree drivers the ability to subvert core aspects of page management. It, and anything derived from it (e.g. hmm, pcip2p, etc...), is a deep integration point into the core kernel, and an EXPORT_SYMBOL_GPL() interface. Commit 31c5bda3a656 "mm: fix exports that inadvertently make put_page() EXPORT_SYMBOL_GPL" was merged ahead of this series to relieve some of the pressure from innocent consumers of put_page(), but now we need this series to address *producers* of device pages. More details and justification in the changelogs. The 0day infrastructure has reported success across 152 configs and this survives the libnvdimm unit test suite. Aside from the controversial bits the diffstat is compelling at: 7 files changed, 126 insertions(+), 323 deletions(-) Note that the series has some minor collisions with Alex's recent series to improve devm_memremap_pages() scalability [2]. So, whichever you take first the other will need a minor rebase. [2]: https://www.lkml.org/lkml/2018/9/11/10 Dan Williams (7): mm, devm_memremap_pages: Mark devm_memremap_pages() EXPORT_SYMBOL_GPL mm, devm_memremap_pages: Kill mapping "System RAM" support mm, devm_memremap_pages: Fix shutdown handling mm, devm_memremap_pages: Add MEMORY_DEVICE_PRIVATE support mm, hmm: Use devm semantics for hmm_devmem_{add,remove} mm, hmm: Replace hmm_devmem_pages_create() with devm_memremap_pages() mm, hmm: Mark hmm_devmem_{add,add_resource} EXPORT_SYMBOL_GPL drivers/dax/pmem.c | 14 -- drivers/nvdimm/pmem.c | 13 +- include/linux/hmm.h | 4 include/linux/memremap.h | 2 kernel/memremap.c | 94 +++++++---- mm/hmm.c | 305 +++++-------------------------------- tools/testing/nvdimm/test/iomap.c | 17 ++ 7 files changed, 126 insertions(+), 323 deletions(-)