Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1685209

Re: [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and enum memory_type one

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and enum memory_type one
Date Tue, 11 Jul 2017 19:00:01 +0200
Message-ID <u26FX-4O2-3@gated-at.bofh.it> (permalink)
References <tZgVb-7a5-1@gated-at.bofh.it> <tZgVc-7a5-35@gated-at.bofh.it> <tZjgm-8te-1@gated-at.bofh.it> <tZTtv-7s2-17@gated-at.bofh.it> <tZVbX-77-1@gated-at.bofh.it> <tZXx7-1xL-13@gated-at.bofh.it> <u1XW3-7MF-51@gated-at.bofh.it> <u24Xx-3TD-51@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Z7E0p7mLlJuXlpuSZ+2wW0JCu7Y34TnTOe1T+ShTJYc=; b=lObW3qwV+NqxAM+buNRFSWIe8DjW1RcGOgZdWkemnLHODiJFISmwZllAbtAoXqlV7D AGie/g8rnMTkHc8O+jUHP9kEgLGBoLrenISuIHOqlzj+prezyf/fa9DDtVpqQZLYh92L vfhw5tCAQGbFY/bo37EyTT+8hzmaYw373C3jgABu6sLEu3s9O3POgidHWN7maivxDEvO mX9F2kETSokNK4jpiZLyB8WYO031S6dQ2iuUrqJpY9Nj3kKZ4yI17okzqTDBPd2N1K0x VUhgUAESxzjbUMOqLTqSWkmZ6vTaK7Bqd2L+zYckZGsMIou23MWuFcHyoUv4910t2ZnN 7x1g==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Z7E0p7mLlJuXlpuSZ+2wW0JCu7Y34TnTOe1T+ShTJYc=; b=IDaSYibMH+K/nV0AkIbt1UfNjE5TcV8Y2IL2lCMUNGeRTzT4asQ1jC20eFHmSkVLBM q/m38fUFqVXaz2/mOZ7spuoBiF/qIubApdSzGJoulglhXqQnG2X4kFtT/5mFcY3iGNBJ lOkF+96GKcjb1Cuz7IYAMVloWuEOxCPUIQWDQY2c3Aq4DFmPXQZq4gQAGK1zLJT5jDOe Dighxx05f3S/8NGB9SXHgx3EWc4q8E3HzP6NLVMOOb8I4qm8jCPZc58MBg0b79+M2BW5 39th5CkEuUbEUmbAfS/d0Uq6KP92NhSyt7Y41G73CkTWWUXqrmpXfC5DrF+asyn4obk1 w10w==
X-Gm-Message-State AIVw1101Gxmee1eEFksbaotrXk7BaccYkCkm97K9bbZ0CVBlHAJl1J7A u4AvprhWRQAAQIBz9U1jhxoVIfGhjh1s
X-Received by 10.129.29.4 with SMTP id d4mr30827ywd.35.1499791793556; Tue, 11 Jul 2017 09:49:53 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 150
Organization linux.* mail to news gateway
X-Original-Cc "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Linux MM <linux-mm@kvack.org>, John Hubbard <jhubbard@nvidia.com>, David Nellans <dnellans@nvidia.com>, Balbir Singh <bsingharora@gmail.com>, Ross Zwisler <ross.zwisler@linux.intel.com>
X-Original-Date Tue, 11 Jul 2017 09:49:53 -0700
X-Original-Message-ID <CAPcyv4hnKwwbSYi_HW7hC8Z2Ox0riBSRgdNGGhSw2_2zSgUFiA@mail.gmail.com>
X-Original-References <20170703211415.11283-1-jglisse@redhat.com> <20170703211415.11283-2-jglisse@redhat.com> <CAPcyv4gXso2W0gxaeTsc7g9nTQnkO3WFNZfsdS95NvfYJupnxg@mail.gmail.com> <20170705142516.GA3305@redhat.com> <CAPcyv4hr+p+Bo8dcPfnW+O2q0KWvoM5z9LPZWhXLFJgE5ySojA@mail.gmail.com> <20170705184933.GD3305@redhat.com> <CAPcyv4g7DOCDrggZO=yVbkKp4He_5gGtMZQQTqwp_-XdidACqg@mail.gmail.com> <20170711150558.GB5347@redhat.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1685209

Show key headers only | View raw


On Tue, Jul 11, 2017 at 8:05 AM, Jerome Glisse <jglisse@redhat.com> wrote:
> On Tue, Jul 11, 2017 at 12:31:22AM -0700, Dan Williams wrote:
>> On Wed, Jul 5, 2017 at 11:49 AM, Jerome Glisse <jglisse@redhat.com> wrote:
>> > On Wed, Jul 05, 2017 at 09:15:35AM -0700, Dan Williams wrote:
>> >> On Wed, Jul 5, 2017 at 7:25 AM, Jerome Glisse <jglisse@redhat.com> wrote:
>> >> > On Mon, Jul 03, 2017 at 04:49:18PM -0700, Dan Williams wrote:
>> >> >> On Mon, Jul 3, 2017 at 2:14 PM, Jérôme Glisse <jglisse@redhat.com> wrote:
>> >> >> > Use consistent name between IORES_DESC and enum memory_type, rename
>> >> >> > MEMORY_DEVICE_PUBLIC to MEMORY_DEVICE_PERSISTENT. This is to free up
>> >> >> > the public name for CDM (cache coherent device memory) for which the
>> >> >> > term public is a better match.
>> >> >> >
>> >> >> > Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
>> >> >> > Cc: Dan Williams <dan.j.williams@intel.com>
>> >> >> > Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
>> >> >> > ---
>> >> >> >  include/linux/memremap.h | 4 ++--
>> >> >> >  kernel/memremap.c        | 2 +-
>> >> >> >  2 files changed, 3 insertions(+), 3 deletions(-)
>> >> >> >
>> >> >> > diff --git a/include/linux/memremap.h b/include/linux/memremap.h
>> >> >> > index 57546a07a558..2299cc2d387d 100644
>> >> >> > --- a/include/linux/memremap.h
>> >> >> > +++ b/include/linux/memremap.h
>> >> >> > @@ -41,7 +41,7 @@ static inline struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start)
>> >> >> >   * Specialize ZONE_DEVICE memory into multiple types each having differents
>> >> >> >   * usage.
>> >> >> >   *
>> >> >> > - * MEMORY_DEVICE_PUBLIC:
>> >> >> > + * MEMORY_DEVICE_PERSISTENT:
>> >> >> >   * Persistent device memory (pmem): struct page might be allocated in different
>> >> >> >   * memory and architecture might want to perform special actions. It is similar
>> >> >> >   * to regular memory, in that the CPU can access it transparently. However,
>> >> >> > @@ -59,7 +59,7 @@ static inline struct vmem_altmap *to_vmem_altmap(unsigned long memmap_start)
>> >> >> >   * include/linux/hmm.h and Documentation/vm/hmm.txt.
>> >> >> >   */
>> >> >> >  enum memory_type {
>> >> >> > -       MEMORY_DEVICE_PUBLIC = 0,
>> >> >> > +       MEMORY_DEVICE_PERSISTENT = 0,
>> >> >> >         MEMORY_DEVICE_PRIVATE,
>> >> >> >  };
>> >> >> >
>> >> >> > diff --git a/kernel/memremap.c b/kernel/memremap.c
>> >> >> > index b9baa6c07918..e82456c39a6a 100644
>> >> >> > --- a/kernel/memremap.c
>> >> >> > +++ b/kernel/memremap.c
>> >> >> > @@ -350,7 +350,7 @@ void *devm_memremap_pages(struct device *dev, struct resource *res,
>> >> >> >         }
>> >> >> >         pgmap->ref = ref;
>> >> >> >         pgmap->res = &page_map->res;
>> >> >> > -       pgmap->type = MEMORY_DEVICE_PUBLIC;
>> >> >> > +       pgmap->type = MEMORY_DEVICE_PERSISTENT;
>> >> >> >         pgmap->page_fault = NULL;
>> >> >> >         pgmap->page_free = NULL;
>> >> >> >         pgmap->data = NULL;
>> >> >>
>> >> >> I think we need a different name. There's nothing "persistent" about
>> >> >> the devm_memremap_pages() path. Why can't they share name, is the only
>> >> >> difference coherence? I'm thinking something like:
>> >> >>
>> >> >> MEMORY_DEVICE_PRIVATE
>> >> >> MEMORY_DEVICE_COHERENT /* persistent memory and coherent devices */
>> >> >> MEMORY_DEVICE_IO /* "public", but not coherent */
>> >> >
>> >> > No that would not work. Device public (in the context of this patchset)
>> >> > is like device private ie device public page can be anywhere inside a
>> >> > process address space either as anonymous memory page or as file back
>> >> > page of regular filesystem (ie vma->ops is not pointing to anything
>> >> > specific to the device memory).
>> >> >
>> >> > As such device public is different from how persistent memory is use
>> >> > and those the cache coherency being the same between the two kind of
>> >> > memory is not a discerning factor. So i need to distinguish between
>> >> > persistent memory and device public memory.
>> >> >
>> >> > I believe keeping enum memory_type close to IORES_DESC naming is the
>> >> > cleanest way to do that but i am open to other name suggestion.
>> >> >
>> >>
>> >> The IORES_DESC has nothing to do with how the memory range is handled
>> >> by the core mm. It sounds like the distinction this is trying to make
>> >> is between MEMORY_DEVICE_{PUBLIC,PRIVATE} and MEMORY_DEVICE_HOST.
>> >> Where a "host" memory range is one that does not need coordination
>> >> with a specific device.
>> >
>> > I want to distinguish between:
>> >   - device memory that is not accessible by the CPU
>> >   - device memory that is accessible by the CPU just like regular
>> >     memory
>> >   - existing user of devm_memremap_pages() which is persistent memory
>> >     (only pmem seems to call devm_memremap_pages()) that is use like a
>> >     filesystem or block device and thus isn't use like generic page in
>> >     a process address space
>> >
>> > So if existing user of devm_memremap_pages() are only persistent memory
>> > then it made sense to match the IORES_DESC we are expecting to see on
>> > see such memory.
>> >
>> > For public device memory (in the sense introduced by this patchset) i
>> > do not know how it will be described by IORES_DESC. i think first folks
>> > with it are IBM with CAPI and i am not sure they defined something for
>> > that already.
>> >
>> > I am open to any name beside public (well any reasonable name :)) but
>> > i do need to be able to distinguish persistent memory as use today from
>> > this device memory.
>>
>> Right, so that's why I suggested MEMORY_DEVICE_HOST for memory that is
>> just normal host memory and does not have any device-entanglements
>> outside of the base ZONE_DEVICE registration.
>
> Well the memory considered for DEVICE_PUBLIC is device memory so it is
> very much entangled with a device. It is memory that is physically on
> the device. It is just that new system bus like CAPI or CCIX allows
> CPU to access such memory with same cache coherency as if they were
> accessing regular system DDR memory. It is expect that this memory
> will be manage by the device driver and not core memory management.
>
> But i am ok with MEMORY_DEVICE_HOST after all this just a name. But
> what you put behind that name is not the reality of the memory. I just
> want to be clear on that.
>

I was suggesting MEMORY_DEVICE_HOST for persistent memory and
MEMORY_DEVICE_PUBLIC as you want for CDM.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] Cache coherent device memory (CDM) with HMM v3 Jérôme Glisse <jglisse@redhat.com> - 2017-07-03 23:20 +0200
  [PATCH 5/5] mm/memcontrol: support MEMORY_DEVICE_PRIVATE and MEMORY_DEVICE_PUBLIC Jérôme Glisse <jglisse@redhat.com> - 2017-07-03 23:20 +0200
  [PATCH 2/5] mm/device-public-memory: device memory cache coherent with CPU v2 Jérôme Glisse <jglisse@redhat.com> - 2017-07-03 23:20 +0200
    Re: [PATCH 2/5] mm/device-public-memory: device memory cache  coherent with CPU v2 Balbir Singh <bsingharora@gmail.com> - 2017-07-11 06:20 +0200
      Re: [PATCH 2/5] mm/device-public-memory: device memory cache  coherent with CPU v2 Jerome Glisse <jglisse@redhat.com> - 2017-07-11 17:00 +0200
        Re: [PATCH 2/5] mm/device-public-memory: device memory cache  coherent with CPU v2 Balbir Singh <bsingharora@gmail.com> - 2017-07-12 08:00 +0200
  [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and enum memory_type one Jérôme Glisse <jglisse@redhat.com> - 2017-07-03 23:20 +0200
    Re: [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and enum  memory_type one Dan Williams <dan.j.williams@intel.com> - 2017-07-04 01:50 +0200
      Re: [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and enum  memory_type one Jerome Glisse <jglisse@redhat.com> - 2017-07-05 16:30 +0200
        Re: [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and enum  memory_type one Dan Williams <dan.j.williams@intel.com> - 2017-07-05 18:20 +0200
          Re: [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and enum  memory_type one Jerome Glisse <jglisse@redhat.com> - 2017-07-05 20:50 +0200
            Re: [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and  enum memory_type one Balbir Singh <bsingharora@gmail.com> - 2017-07-11 05:50 +0200
            Re: [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and enum  memory_type one Dan Williams <dan.j.williams@intel.com> - 2017-07-11 09:40 +0200
              Re: [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and enum  memory_type one Jerome Glisse <jglisse@redhat.com> - 2017-07-11 17:10 +0200
                Re: [PATCH 1/5] mm/persistent-memory: match IORES_DESC name and enum  memory_type one Dan Williams <dan.j.williams@intel.com> - 2017-07-11 19:00 +0200
  [PATCH 4/5] mm/memcontrol: allow to uncharge page without using page->lru field Jérôme Glisse <jglisse@redhat.com> - 2017-07-03 23:20 +0200
    Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Michal Hocko <mhocko@kernel.org> - 2017-07-04 15:00 +0200
      Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Balbir Singh <bsingharora@gmail.com> - 2017-07-05 05:20 +0200
        Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Michal Hocko <mhocko@kernel.org> - 2017-07-05 08:40 +0200
          Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Balbir Singh <bsingharora@gmail.com> - 2017-07-05 12:30 +0200
      Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Jerome Glisse <jglisse@redhat.com> - 2017-07-05 16:40 +0200
        Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Michal Hocko <mhocko@kernel.org> - 2017-07-10 10:30 +0200
          Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Jerome Glisse <jglisse@redhat.com> - 2017-07-10 17:40 +0200
            Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Michal Hocko <mhocko@kernel.org> - 2017-07-10 18:10 +0200
              Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Jerome Glisse <jglisse@redhat.com> - 2017-07-10 18:30 +0200
                Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Michal Hocko <mhocko@kernel.org> - 2017-07-10 18:40 +0200
                Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Jerome Glisse <jglisse@redhat.com> - 2017-07-10 19:00 +0200
                Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Michal Hocko <mhocko@kernel.org> - 2017-07-10 19:50 +0200
                Re: [PATCH 4/5] mm/memcontrol: allow to uncharge page without using  page->lru field Jerome Glisse <jglisse@redhat.com> - 2017-07-10 20:20 +0200
  [PATCH 3/5] mm/hmm: add new helper to hotplug CDM memory region Jérôme Glisse <jglisse@redhat.com> - 2017-07-03 23:20 +0200

csiph-web