linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <dchinner@redhat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Chris Mason <clmason@fusionio.com>,
	Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	David Woodhouse <David.Woodhouse@intel.com>,
	"bo.li.liu@oracle.com" <bo.li.liu@oracle.com>,
	"rp@svcs.cs.pdx.edu" <rp@svcs.cs.pdx.edu>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Stephen Hemminger <shemminger@vyatta.com>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [RFC] RCU Judy array with distributed locking for FS extents
Date: Tue, 4 Jun 2013 21:54:56 +1000	[thread overview]
Message-ID: <20130604115456.GB2099@devil.localdomain> (raw)
In-Reply-To: <20130603124601.GA2922@Krystal>

On Mon, Jun 03, 2013 at 08:46:01AM -0400, Mathieu Desnoyers wrote:
> * Chris Mason (clmason@fusionio.com) wrote:
> > Quoting Mathieu Desnoyers (2013-06-03 01:27:58)
> > > Hi Chris,
> > > 
> > > I stumbled the LWN article "A kernel skiplist implementation (Part 1)",
> > > and really thought I should tell you about the side-project I am
> > > currently working on: RCU Judy array, with locking distributed within
> > > the data structure. I developed my own design of this structure
> > > specifically to be usable with RCU. (ref. my LPC2012 presentation:
> > > https://www.efficios.com/lpc2012-scaling-rcu-judy-arrays-cache-efficient-compact-fast-and-scalable-trie)
> > > 
> > > I think it would fit your extents use-case perfectly, with excellent
> > > cache usage, constant lookup time, near-linear scalability for lookups,
> > > and pretty good update scability.
> > > 
> > > The code is available in a development branch of the Userspace RCU
> > > library:
> > > 
> > > git://git.lttng.org/userspace-rcu.git branch: urcu/rcuja
> > > https://git.lttng.org/?p=userspace-rcu.git;a=shortlog;h=refs/heads/urcu/rcuja
> > > 
> > > It runs entirely in user-space, although it can be ported easily to the
> > > Linux kernel. I'd be curious to see how it behaves with your workload.
> > > 
> > > Relevant files:
> > > - rcuja/design.txt: design document of the data structure,
> > > - urcu/rcuja.h (public API)
> > > - rcuja/*.[ch]: implementation
> > > - tests/test_urcu_ja.c: stress-tests, example usage.
> > > 
> > > After reading the article on skiplists, I added a new API specifically
> > > to handle non-overlapping ranges:
> > > 
> > > struct cds_hlist_head cds_ja_lookup_lower_equal(struct cds_ja *ja,
> > >                 uint64_t key);
> > > 
> > > AFAIU, "extents", as far as keys are concerned, are nothing more than
> > > segments, with start and end values.
> > > 
> > > Extents can be indexed by the Judy array in the following way: we use
> > > the start of segment as node key, and keep the end of segment value
> > > within the leaf node. We add those nodes into the judy array, indexed by
> > > start-of-segment value. Then, when we want to figure out if a value
> > > matches a segment, we do the following:
> > > 
> > > 1) lookup the possible segment match with cds_ja_lookup_lower_equal(),
> > >    passing the key to lookup as parameter,
> > > 
> > > 2) check that our key fits within the range of the segment using the
> > >    end-of-segment value within the leaf node.
> > > 
> > > Of course, this approach is limited to non-overlapping segments, so I
> > > hope this is what you need.
> > 
> > Hi Mathieu,
> > 
> > One problem here is that XFS wants to allow duplicate keys in the tree.
> > This is possible with some modifications to the skiplist code, but I'm
> > not sure if it fits into your description above.
> 
> Are those segments that completely overlap, or partially overlap ?

Partial overlap. Can be wholly within an existing exist, or overlap
start, end or both.

Cheers,

Dave.
-- 
Dave Chinner
dchinner@redhat.com

  parent reply	other threads:[~2013-06-04 11:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03  5:27 [RFC] RCU Judy array with distributed locking for FS extents Mathieu Desnoyers
2013-06-03 12:40 ` Chris Mason
2013-06-03 12:46   ` Mathieu Desnoyers
2013-06-03 13:07     ` Chris Mason
2013-06-03 13:50       ` Mathieu Desnoyers
2013-06-04 11:54     ` Dave Chinner [this message]
2013-06-04 14:21       ` Chris Mason
2013-06-04 18:57         ` Mathieu Desnoyers
2013-06-05 23:48         ` Dave Chinner
2013-06-12  1:12         ` Mathieu Desnoyers
2013-06-13  1:25           ` Chris Mason
2013-06-16 14:02             ` Liu Bo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130604115456.GB2099@devil.localdomain \
    --to=dchinner@redhat.com \
    --cc=David.Woodhouse@intel.com \
    --cc=bo.li.liu@oracle.com \
    --cc=clmason@fusionio.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rp@svcs.cs.pdx.edu \
    --cc=shemminger@vyatta.com \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).