Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [ltt-dev] RCU lock-free hash table updates
Date: Tue, 13 Sep 2011 23:57:57 -0400	[thread overview]
Message-ID: <20110914035757.GA24701@Krystal> (raw)

Hi everyone,

A little update following my presentation at Linux Plumbers Conference
2011 on the RCU lock-free hash table in development within the
userspace-rcu git tree (presentation slides available at
http://www.efficios.com/lpc2011-urcu). I created a new branch
(urcu/ht-shrink-help) that lets the lookup, add and remove operations
help the expand and shrink algorithms, thus getting closer to a
lock-free semantic that takes interaction between resize and updates
into account.

I also implemented some simplifications to the data structures (proposed
by Josh), where the top-level log(n) table is now allocated only once at
hash table creation, and only its size is updated, rather than using a
needlessly complex reallocation/delayed free scheme.

Finally, I managed to make the response of resize to drastic changes to
the flow of updates (e.g. an ongoing shrink, and suddenly all threads
start adding nodes instead of removing them) much better by checking if
the resize target changes between each order-of-two step of the resize
operation, cancelling the following shrink steps if they are not needed
anymore (same for expand cancellation). With the combination of the
"help" scheme (add, removal and lookups helping the resize) and this
opportunistic cancellation, the hash table supports being shrunk a size
1 bucket, followed by a storm of insertions coming from 8 cores, without
any problem. I'm currently stress-testing this code using an external
SIGUSR1 signal that changes the behavior between add/remove/random in
loops for hours/days to ensure it is solid.

The code is available at:

http://git.lttng.org/?p=userspace-rcu.git;a=tree;h=refs/heads/urcu/ht-shrink-help;hb=urcu/ht-shrink-help

files:
rculfhash.c
urcu/rculfhash.h
tests/test_urcu_hash.c (-A option to activate automatic resize)

Comments are welcome,

Best regards,

Mathieu

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




                 reply	other threads:[~2011-09-14  3:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20110914035757.GA24701@Krystal \
    --to=mathieu.desnoyers@efficios.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