From patchwork Tue Sep 25 06:14:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10613425 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 2139C913 for ; Tue, 25 Sep 2018 06:27:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 137782986A for ; Tue, 25 Sep 2018 06:27:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0807529870; Tue, 25 Sep 2018 06:27:00 +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 CE25429867 for ; Tue, 25 Sep 2018 06:26:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 777A58E0062; Tue, 25 Sep 2018 02:26:57 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7274D8E0041; Tue, 25 Sep 2018 02:26:57 -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 5EF898E0062; Tue, 25 Sep 2018 02:26:57 -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 1FAEF8E0041 for ; Tue, 25 Sep 2018 02:26:57 -0400 (EDT) Received: by mail-pg1-f199.google.com with SMTP id r20-v6so9260496pgv.20 for ; Mon, 24 Sep 2018 23:26:57 -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=kplQyaHUrP9t3CnZ84ZR2cysN0ESFTtRYwo2BOp/ld4=; b=bktR4y/sYCpMWB1A1lTsPKukD3uyP3w6TsJjeHHaAjylMz4oTC7EOJCQRWFfECtl1q 2pTeaygJdKRQWEKEQSQ+USXMG0beVl2ka5iTulNpU+vHTvvQF/YSopnU6j11g0Rq8YWF PsnOsh3Z8BPYKcEa1Q/ZrnCFAQy2NW6JC8IOVoHpiG8m2qWwTtUtzXC8OOCWcayi0y7a mR40uBBBBroTTsNRIJyX4LuT29fbngGRtKWE6uq+t5V4Y86/4/+4W6EeDr0NTC8gOiAY RLBdWFxlsmKURKJtSsrFkt3xdLU35rraktxliQNY0zW71y3DzAk3tveCkhfsRm4M4vyW yFFA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.24 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: ABuFfohYqjNdnoNcVZSLKQAMxzlChm/ugkX4o620KGS/6ChvyZIPgmxM b7A5y06Bf63qsOu1VrjyScjioYmsVf1D91HFmZF6EBDWj+pqyni+XuybqcQKOoL0k9kNmXMZfAP F3edEtlTTVF11WkfUnd8QF2q8d3EUAnWZexEStTgxVXywHwAz1ejtk+pFb9mHr9BFgA== X-Received: by 2002:a63:c347:: with SMTP id e7-v6mr1900349pgd.240.1537856816722; Mon, 24 Sep 2018 23:26:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV60la+dslxu+pSpcK5zFxAvwLCXiIMok1WB8ESsRQ9uHKXeYQIn5FdGbA+DedJxxuX4NZ5yZ X-Received: by 2002:a63:c347:: with SMTP id e7-v6mr1900307pgd.240.1537856815750; Mon, 24 Sep 2018 23:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537856815; cv=none; d=google.com; s=arc-20160816; b=Vmj+drQ7mfzhuO3OmdSSUCg5ygORooUlXJq5midxJNe1L3EEFJB9qV7QBdPwbal87L 5Rgu8OqOAQAbDRJ9bpeBrWkRnKPIKvr7vcYCt//JEkgBD3D+SISdzb3JQ3ub2EiyOjpG pJA1JvfVEC4cYxQqdKjqOcOrWswktYNAkoDW2JRvdC/jGOGdTzUfY3bov71zbYx/dFs8 TGpV6HLc74f1ez1JjIkV4We12A1jIxClASQ4AyIGYuq914Lpj9Yo9k78Ne1h7OvOpPy7 yaU1GF2ayx1toxVGWFi+Q354MeU8sj+GxbQqbttI74IJEt3nejWhr8QyvQ5xTN37MHAx wPbw== 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=kplQyaHUrP9t3CnZ84ZR2cysN0ESFTtRYwo2BOp/ld4=; b=0Sy2Nzt7/096WkAIjVHiVXUJCccEF4jGFfApZwdMqddLsGCnSGjfdh2Cbve+Kpprnv PzVZIF4adwHH6n+rag1PBN8EyYzx9Q31E3+7oQywgMecRTo2bdZ1Dkkj+mY6+vZ3BRFz axs5Hfi3eCstFd6T4o0QX2wEHCX3pwabI3uCpWJc469JWObaqahngE0VNZ7uFk5LAOyM ccznAq/9fBnACjmFCFtkN3yrWAU2rOR7S6q1e423/yHnfUCFVO93S/SMiHSaNX0wlqKW Nf2VnZtkWrDRPQdJgqmNJ/XzbH3BXbV/tpR6Aduomtcu5BZ52i/whpXubB447VnABhde h1mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.24 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga09.intel.com (mga09.intel.com. [134.134.136.24]) by mx.google.com with ESMTPS id be11-v6si1484587plb.347.2018.09.24.23.26.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 23:26:55 -0700 (PDT) Received-SPF: pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.24 as permitted sender) client-ip=134.134.136.24; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.24 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 orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2018 23:26:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,301,1534834800"; d="scan'208";a="75955768" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga008.jf.intel.com with ESMTP; 24 Sep 2018 23:26:42 -0700 Subject: [PATCH v6 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 , alexander.h.duyck@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Mon, 24 Sep 2018 23:14:54 -0700 Message-ID: <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 Changes since v5 [1]: * Move the percpu-ref kill function to be passed in via @pgmap (Christoph) * Added Christoph's ack for patches 2 and 4 * Added Jérôme's Reviewed-by for patches 2-6 * Fix MEMORY_DEVICE_PRIVATE support (Jérôme) [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, 127 insertions(+), 321 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 | 95 +++++++----- mm/hmm.c | 303 +++++-------------------------------- tools/testing/nvdimm/test/iomap.c | 17 ++ 7 files changed, 127 insertions(+), 321 deletions(-)