linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Liu Bo <liubo2009@cn.fujitsu.com>
Cc: <linux-btrfs@vger.kernel.org>, <chris.mason@oracle.com>,
	<josef@redhat.com>, <dave@jikos.cz>
Subject: Re: [RFC PATCH v2 0/3] Btrfs: apply the Probabilistic Skiplist on btrfs
Date: Thu, 12 Jan 2012 13:28:12 -0800	[thread overview]
Message-ID: <m21ur4sj9v.fsf@firstfloor.org> (raw)
In-Reply-To: <1326180696-3614-1-git-send-email-liubo2009@cn.fujitsu.com> (Liu Bo's message of "Tue, 10 Jan 2012 15:31:33 +0800")

Liu Bo <liubo2009@cn.fujitsu.com> writes:
>
> Here we choose extent_map firstly, since it is a "read mostly" thing,
> and the change is quite direct, all we need to do is
> a) to replace rbtree with skiplist,
> b) to add rcu support.
> And more details are in patch 2 and patch 3.
>
> I've done some simple tests for performance on my 2-core box, there is no
> obvious difference, but I want to focus on the design side and make sure
> there is no more bug in it firstly.
>
> For long term goals, we want to ship skiplist to lib, like lib/rbtree.c.

I looked at skiplists some time ago. What made them awkward for kernel
use is that you have to size the per node skip array in advance and it's
hard to resize. So you have a node that wastes memory in common small
cases, but still degenerates to linked list on very large sizes.
With fine grained locking it gets even worse because the nodes get larger.

Con didn't worry about this problem because he assumed the scheduler
run queues never could get too long.

But for a very scalable subsystem that's definitely a problem.

I think skiplists are not a good fit here.

At least in our tests the older style trees got a lot better with Chris'
recent locking improvements. 

Now replacing rbtrees is probably still a good idea, but not convinced
skiplist are suitable here. There were various other tree alternatives
with better locking.

-Andi

  parent reply	other threads:[~2012-01-12 21:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10  7:31 [RFC PATCH v2 0/3] Btrfs: apply the Probabilistic Skiplist on btrfs Liu Bo
2012-01-10  7:31 ` [RFC PATCH v2 1/3] Btrfs: add the Probabilistic Skiplist Liu Bo
2012-01-11  0:37   ` David Sterba
2012-01-11  2:06     ` Liu Bo
2012-01-11 14:41       ` David Sterba
2012-01-11  1:36   ` David Sterba
2012-01-10  7:31 ` [RFC PATCH v2 2/3] Btrfs: rebuild extent_map based on skiplist Liu Bo
2012-01-10  7:31 ` [RFC PATCH v2 3/3] Btrfs: convert rwlock to RCU for extent_map Liu Bo
2012-01-12 21:28 ` Andi Kleen [this message]
2012-01-13  2:18   ` [RFC PATCH v2 0/3] Btrfs: apply the Probabilistic Skiplist on btrfs Liu Bo
2012-01-13  4:10     ` Dave Chinner
2012-01-13  9:01       ` Andi Kleen

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=m21ur4sj9v.fsf@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=chris.mason@oracle.com \
    --cc=dave@jikos.cz \
    --cc=josef@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=liubo2009@cn.fujitsu.com \
    /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).