From: Joe Seigh <jseigh_02@xemaps.com>
To: linux-kernel@vger.kernel.org
Subject: Re: rcu-refcount stacker performance
Date: Thu, 14 Jul 2005 20:29:57 -0400 [thread overview]
Message-ID: <db6vsm$fpm$1@sea.gmane.org> (raw)
In-Reply-To: <20050714171357.GA23309@serge.austin.ibm.com>
serue@us.ibm.com wrote:
> Quoting Paul E. McKenney (paulmck@us.ibm.com):
>>OK, but in the above case, "do something" cannot be sleeping, since
>>it is under rcu_read_lock().
>
>
> Oh, but that's not quite what the code is doing, rather it is doing:
>
> rcu_read_lock
> while get next element from list
> inc element.refcount
> rcu_read_unlock
> do something
> rcu_read_lock
> dec refcount
> rcu_read_unlock
>
I've been experimenting with various lock-free methods in user space, which
is preemptive. Stuff like RCU, RCU+SMR which I've mentioned before,
and some atomically thread-safe reference counting. I have a proxy
GC based on the latter called APPC (atomic pointer proxy collector).
Basically you use a proxy refcounted object for the whole list
rather than every element in the list. Before you access the list,
you increment the refcount of the proxy object, and afterwards you
decrement it. One interlocked instruction for each so performance
wise it looks like a reader lock which never blocks.
Writers enqueue deleted nodes on the collector object and then
push a new collector object in place.
The collector objects look like
proxy_anchor -> c_obj <- c_obj <- c_obj
^
| reader
The previous collector objects are back linked so when a reader
thread releases it, all unreference collector objects have
deallocation performed on them and attached nodes.
A bit sketchy. You can see a working example of this using
C++ refcounted pointers (which can't be used in the kernel
naturally, you'll have to implement your own) at
http://atomic-ptr-plus.sourceforge.net/
--
Joe Seigh
next prev parent reply other threads:[~2005-07-15 0:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-14 14:21 rcu-refcount stacker performance serue
2005-07-14 15:23 ` Paul E. McKenney
2005-07-14 13:44 ` serue
2005-07-14 16:59 ` Paul E. McKenney
2005-07-14 17:13 ` serue
2005-07-14 18:50 ` Paul E. McKenney
2005-07-14 19:09 ` serue
2005-07-15 0:29 ` Joe Seigh [this message]
2005-07-15 13:59 ` Joe Seigh
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='db6vsm$fpm$1@sea.gmane.org' \
--to=jseigh_02@xemaps.com \
--cc=linux-kernel@vger.kernel.org \
/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