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


Groups > linux.kernel > #1464786

Re: [PATCH 5/7] dax: lock based on slot instead of [mapping, index]

From Ross Zwisler <ross.zwisler@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 5/7] dax: lock based on slot instead of [mapping, index]
Date 2016-08-17 22:30 +0200
Message-ID <s7fDj-5XM-17@gated-at.bofh.it> (permalink)
References <s6vAt-18k-11@gated-at.bofh.it> <s6vAu-18k-33@gated-at.bofh.it> <s6J0K-1lo-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Aug 16, 2016 at 11:28:16AM +0200, Jan Kara wrote:
> On Mon 15-08-16 13:09:16, Ross Zwisler wrote:
> > DAX radix tree locking currently locks entries based on the unique
> > combination of the 'mapping' pointer and the pgoff_t 'index' for the entry.
> > This works for PTEs, but as we move to PMDs we will need to have all the
> > offsets within the range covered by the PMD to map to the same bit lock.
> > To accomplish this, lock based on the 'slot' pointer in the radix tree
> > instead of [mapping, index].
> 
> I'm not convinced this is safe. What makes the slot pointer still valid
> after you drop tree_lock? At least radix_tree_shrink() or
> radix_tree_expand() could move your slot without letting the waiter know
> and he would be never woken.
> 
> 								Honza

Yep, you're right, thanks for catching that.

Given that we can't rely on 'slot' being stable, my next idea is to use a
combination of [mapping, index], but tweak 'index' so that it's always the
beginning of the entry.  So for 4k entries we'd leave it alone, but for 2MiB
entries we'd mask it down to the appropriate 2MiB barrier.

Let me hack on that for a bit, unless you've a better idea.

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


Thread

[PATCH 0/7] re-enable DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-08-15 21:20 +0200
  [PATCH 5/7] dax: lock based on slot instead of [mapping, index] Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-08-15 21:20 +0200
    Re: [PATCH 5/7] dax: lock based on slot instead of [mapping, index] Jan Kara <jack@suse.cz> - 2016-08-16 11:40 +0200
      Re: [PATCH 5/7] dax: lock based on slot instead of [mapping, index] Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-08-17 22:30 +0200
        Re: [PATCH 5/7] dax: lock based on slot instead of [mapping, index] Jan Kara <jack@suse.cz> - 2016-08-18 16:20 +0200
  [PATCH 2/7] ext4: tell DAX the size of allocation holes Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-08-15 21:20 +0200
    Re: [PATCH 2/7] ext4: tell DAX the size of allocation holes Jan Kara <jack@suse.cz> - 2016-08-16 11:20 +0200
  Re: [PATCH 0/7] re-enable DAX PMD support Dan Williams <dan.j.williams@intel.com> - 2016-08-15 22:30 +0200
    Re: [PATCH 0/7] re-enable DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-08-15 23:20 +0200
      Re: [PATCH 0/7] re-enable DAX PMD support Dan Williams <dan.j.williams@intel.com> - 2016-08-15 23:20 +0200
        Re: [PATCH 0/7] re-enable DAX PMD support Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-08-17 18:30 +0200
          Re: [PATCH 0/7] re-enable DAX PMD support Jan Kara <jack@suse.cz> - 2016-08-17 19:30 +0200

csiph-web