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


Groups > linux.kernel > #1207067

Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to __pfn_t + kmap_atomic_pfn_t()

From Dan Williams <dan.j.williams@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to __pfn_t + kmap_atomic_pfn_t()
Date 2015-08-13 21:00 +0200
Message-ID <pX5Tj-3pd-7@gated-at.bofh.it> (permalink)
References <pWR3X-7zZ-1@gated-at.bofh.it> <pWR3Y-7zZ-3@gated-at.bofh.it> <pWUbv-3xi-5@gated-at.bofh.it> <pX2C6-7ft-19@gated-at.bofh.it> <pX3HP-kx-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 13, 2015 at 9:34 AM, Boaz Harrosh <boaz@plexistor.com> wrote:
> On 08/13/2015 06:21 PM, Dan Williams wrote:
>> On Wed, Aug 12, 2015 at 11:26 PM, Boaz Harrosh <boaz@plexistor.com> wrote:
> <>
>>
>> Hmm, that's not the same block layer I've been working with for the
>> past several years:
>>
>> $ mount /dev/pmem0 /mnt
>> $ echo namespace0.0 > ../drivers/nd_pmem/unbind # succeeds
>>
>> Unbind always proceeds unconditionally.  See the recent kernel summit
>> topic discussion around devm vs unbind [1].  While kmap_atomic_pfn_t()
>> does not implement revoke semantics it at least forces re-validation
>> and time bounded references.  For the unplug case we'll need to go
>> shootdown those DAX mappings in userspace so that they return SIGBUS
>> on access, or something along those lines.
>>
>
> Then fix unbind to refuse. What is the point of unbind when it trashes
> the hot path so badly and makes the code so fat.

What? The DAX hot path avoids the kernel entirely.

> Who uses it and what for?

The device driver core.  We simply can't hold off remove indefinitely.
If the administrator wants the device disabled we need to tear down
and revoke active mappings, or at very least guarantee time bounded
removal.

> First I ever heard of it and I do use Linux a little bit.
>
>> [1]: http://www.spinics.net/lists/kernel/msg2032864.html
>>
> Hm...
>
> OK I hate it. I would just make sure to override and refuse unbinding with an
> elevated ref count. Is not a good reason for me to trash the hotpath.

Again, the current usages are not in hot paths.  If it becomes part of
a hot path *and* shows up in a profile we can look to implement
something with less overhead.  Until then we should plan to honor the
lifetime as defined by ->probe() and ->remove().

In fact I proposed the same as you, but then changed my mind based on
Tejun's response [1].  So please reconsider this idea to solve the
problem by blocking ->remove().  PMEM is new and special, but not
*that* special as to justify breaking basic guarantees.

[1]: https://lkml.org/lkml/2015/7/15/731
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH v5 0/5] introduce __pfn_t for unmapped pfn I/O and DAX  lifetime Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
  [PATCH v5 1/5] mm: move __phys_to_pfn and __pfn_to_phys to  asm/generic/memory_model.h Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
  [PATCH v5 5/5] scatterlist: convert to __pfn_t Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
  [PATCH v5 3/5] dax: drop size parameter to ->direct_access() Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
  [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
    Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 08:00 +0200
      Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA Dan Williams <dan.j.williams@intel.com> - 2015-08-13 15:00 +0200
        Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 15:30 +0200
          Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Christoph Hellwig <hch@lst.de> - 2015-08-13 16:50 +0200
            Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 17:10 +0200
      Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Christoph Hellwig <hch@lst.de> - 2015-08-13 16:40 +0200
        Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 16:50 +0200
          Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 17:30 +0200
          Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into  KVA Dave Hansen <dave@sr71.net> - 2015-08-13 19:40 +0200
    Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA Matthew Wilcox <willy@linux.intel.com> - 2015-08-13 19:40 +0200
      Re: [PATCH v5 2/5] allow mapping page-less memremaped areas into KVA Dan Williams <dan.j.williams@intel.com> - 2015-08-13 20:20 +0200
  [PATCH v5 4/5] dax: fix mapping lifetime handling,  convert to __pfn_t + kmap_atomic_pfn_t() Dan Williams <dan.j.williams@intel.com> - 2015-08-13 05:10 +0200
    Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to  __pfn_t + kmap_atomic_pfn_t() Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 08:30 +0200
      Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to  __pfn_t + kmap_atomic_pfn_t() Dan Williams <dan.j.williams@intel.com> - 2015-08-13 17:30 +0200
        Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to  __pfn_t + kmap_atomic_pfn_t() Boaz Harrosh <boaz@plexistor.com> - 2015-08-13 18:40 +0200
          Re: [PATCH v5 4/5] dax: fix mapping lifetime handling, convert to  __pfn_t + kmap_atomic_pfn_t() Dan Williams <dan.j.williams@intel.com> - 2015-08-13 21:00 +0200

csiph-web