Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2315496yba; Sun, 7 Apr 2019 15:12:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOgMT4SdRdLiQhOKATPWn/+l7LTUtgZHjuerqFZkBE7zkWPR8+7Lr3Qvu2hKy0OBIfYL1m X-Received: by 2002:a17:902:e90b:: with SMTP id cs11mr19542809plb.243.1554675153935; Sun, 07 Apr 2019 15:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554675153; cv=none; d=google.com; s=arc-20160816; b=Jq2bec1UowZiGrvLlU4NEEDLWkHt7/K5mDaUQKz74MIa9y7bVo8pbWR6W35uBNlsPS 1x4GBlC3+XPEwC1ky6mpvSiPPUoYqG1hSkS5gvmiuP3P+xgtpLI+ZUWGsW29PpmeFAQD fDfsMoZ4BedejEmye5N+ksFdbWLkUHP/l7Grz6xmdamGZq0PCHgNDqzOuA1rarG6RAPG nETKJQZOtH+ftuChSl9S9H0CX5F9NxZJCF4kzQwQ8uXv5owO9Ed/9YS27dJKbnGb8pTV QS9D8UMTN/GmtNvUoYSfWUkjFlFLGxsFR+GurHLFF2EFLinndmueomN1fM+GL+ekHJl2 /cag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=B2XZYc73eRD7vceltyVRxYxMZptJ0KGjDTZjSsKaM94=; b=sd8ofaIqCuGHuaV/ezLIYoUglvblNZKg2XrC/KBuMvLVX4rGa/kiD+Tl2wHrP+7+nM OUuBQyebIcxQN5UXbPx08e/OIy4jC6j+/Kmeowbet4U1fvxyOXU4Y+TV8gDeoH6EABXs p1TPxPV8uJFCf/mCAfWwuuGC9K1R11GDb2dOXNEAl9w66RhVnmqMt1IPJqWM8yRrCXZj fo8xJ1KHlZynIfQO6yheMUHGXwEE6mF6YvqvvbgoKUc1Ot6jI2kJCRGqRrYV22XVbvnJ t1tWyQ+nse/PN09MjA9GlXaPABq+g2QD7B1Wh4BiyGF0GYoIQ10S0tyKmPJcxYOpxD0A rsVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=VF6J7VpL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 133si26421251pfu.82.2019.04.07.15.12.18; Sun, 07 Apr 2019 15:12:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=VF6J7VpL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726538AbfDGWLN (ORCPT + 99 others); Sun, 7 Apr 2019 18:11:13 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:45348 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726396AbfDGWLN (ORCPT ); Sun, 7 Apr 2019 18:11:13 -0400 Received: by mail-oi1-f195.google.com with SMTP id y84so8928424oia.12 for ; Sun, 07 Apr 2019 15:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=B2XZYc73eRD7vceltyVRxYxMZptJ0KGjDTZjSsKaM94=; b=VF6J7VpLiFG+tX7uSQBIb+AwaLMM5daXTCJr5O14/07I+crMC/7CyhhDhw/rkhgzqV QAJpzGmLF77WW5GGQgOi7zXJLDOUf9PWcJXZpAaDnR8G2Z/o32w5PyVXb2/17NUKOENd ILp3C+qJyDufmz/H2FvScxkpoEoX8y3/OKQkd3xj2xNV8GjV5iFpzzmF+UKZJX1J+Nbv +s8qytEbKUXRw946ci+uDxo4I/DMq3otb4OcjI6kzqUlEJ+XYDKXR8Rkk3WUGRzttS9r 3gvfgcy6yRVczoPA5o6/ZvBoApQtsCN3QuyBLTFSXyHZBeidoj1Uji54NX/l7khGIYFi 58RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B2XZYc73eRD7vceltyVRxYxMZptJ0KGjDTZjSsKaM94=; b=pLzpMUb/DKMNiHW5fkZw5ZID+iMyWRr7LaO0K3gY/+cWvv2s6kDoJNe8D0J8nMYXk8 5b54+Aq6Wjm/V7LN4LpuODkvO+ODA+TOwQA58nN1BawJPy6S9QOaZYkyxUyzI6aZ7it6 TiWusJ/s+EApFcgZs8Kh1ICGdYJo9hj45a4eBjh3a6O1QoXraK+q2HDSCsKA1zdNbbfa uBzEO1stHlMFLMSuMRDP8Q57fEwVMfJan1iM/rhVKuuwCM4GBIAZwCBComdhnAzdmOHA WTLOqaE9TRXy6u6AXwkR8X6kO5eOm9awLMgFMTATMiRb1Kki14w5JChRkiqtZWzrotoj ayvA== X-Gm-Message-State: APjAAAXNajwAyhicF4qbTwIhL1lcZQiLfNdgnFWi3VS6RqiTs8Rh00g7 tpeLBKp8MHAeuhAE8zY1O3Wp1K8/9T5xHNQMB/+3Hw== X-Received: by 2002:aca:f581:: with SMTP id t123mr14992918oih.0.1554675072260; Sun, 07 Apr 2019 15:11:12 -0700 (PDT) MIME-Version: 1.0 References: <1554265806-11501-1-git-send-email-anshuman.khandual@arm.com> <1554265806-11501-7-git-send-email-anshuman.khandual@arm.com> <0d72db39-e20d-1cbd-368e-74dda9b6c936@arm.com> In-Reply-To: From: Dan Williams Date: Sun, 7 Apr 2019 15:11:00 -0700 Message-ID: Subject: Re: [PATCH 6/6] arm64/mm: Enable ZONE_DEVICE To: Robin Murphy Cc: Anshuman Khandual , Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org, Linux MM , Andrew Morton , Will Deacon , Catalin Marinas , Michal Hocko , Mel Gorman , james.morse@arm.com, Mark Rutland , cpandya@codeaurora.org, arunks@codeaurora.org, osalvador@suse.de, Logan Gunthorpe , David Hildenbrand , cai@lca.pw, =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , "Weiny, Ira" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 4, 2019 at 2:47 AM Robin Murphy wrote: > > On 04/04/2019 06:04, Dan Williams wrote: > > On Wed, Apr 3, 2019 at 9:42 PM Anshuman Khandual > > wrote: > >> > >> > >> > >> On 04/03/2019 07:28 PM, Robin Murphy wrote: > >>> [ +Dan, Jerome ] > >>> > >>> On 03/04/2019 05:30, Anshuman Khandual wrote: > >>>> Arch implementation for functions which create or destroy vmemmap mapping > >>>> (vmemmap_populate, vmemmap_free) can comprehend and allocate from inside > >>>> device memory range through driver provided vmem_altmap structure which > >>>> fulfils all requirements to enable ZONE_DEVICE on the platform. Hence just > >>> > >>> ZONE_DEVICE is about more than just altmap support, no? > >> > >> Hot plugging the memory into a dev->numa_node's ZONE_DEVICE and initializing the > >> struct pages for it has stand alone and self contained use case. The driver could > >> just want to manage the memory itself but with struct pages either in the RAM or > >> in the device memory range through struct vmem_altmap. The driver may not choose > >> to opt for HMM, FS DAX, P2PDMA (use cases of ZONE_DEVICE) where it may have to > >> map these pages into any user pagetable which would necessitate support for > >> pte|pmd|pud_devmap. > > > > What's left for ZONE_DEVICE if none of the above cases are used? > > > >> Though I am still working towards getting HMM, FS DAX, P2PDMA enabled on arm64, > >> IMHO ZONE_DEVICE is self contained and can be evaluated in itself. > > > > I'm not convinced. What's the specific use case. > > The fundamental "roadmap" reason we've been doing this is to enable > further NVDIMM/pmem development (libpmem/Qemu/etc.) on arm64. The fact > that ZONE_DEVICE immediately opens the door to the various other stuff > that the CCIX folks have interest in is a definite bonus, so it would > certainly be preferable to get arm64 on par with the current state of > things rather than try to subdivide the scope further. > > I started working on this from the ZONE_DEVICE end, but got bogged down > in trying to replace my copied-from-s390 dummy hot-remove implementation > with something proper. Anshuman has stepped in to help with hot-remove > (since we also have cloud folks wanting that for its own sake), so is > effectively coming at the problem from the opposite direction, and I'll > be the first to admit that we've not managed the greatest job of meeting > in the middle and coordinating our upstream story; sorry about that :) > > Let me freshen up my devmap patches and post them properly, since that > discussion doesn't have to happen in the context of hot-remove; they're > effectively just parallel dependencies for ZONE_DEVICE. Sounds good. It's also worth noting that Ira's recent patches for supporting get_user_pages_fast() for "longterm" pins relies on PTE_DEVMAP to determine when fast-GUP is safe to proceed, or whether it needs to fall back to slow-GUP. So it really is the case that "devmap" support is an assumption for ZONE_DEVICE.