On Thu, Apr 16, 2009 at 10:19:02PM -0400, Mathieu Desnoyers wrote:
That is what they -all- say!!! ;-)
I wouldn't expect more than about three or four orders of magnitude
improvement on the update side compared to Classic RCU, but who knows?
The iterating on each thread was what stopped me.
I believe that it is safe. Only one bit of rcu_fgp_ctr ever changes,
so we should be immune from load tearing. We only load it once and
only do one thing with it, and we have a barrier() before (as part
of preempt_disable()) and after, so I don't think that the compiler
has much latitude here. In theory, we could get store tearing through
*uarp, but if gcc did that, much of the kernel would go down in flames.
In contrast, in the user-mode version, there was no barrier() on entry,
permitting the compiler much more mischief.
If you insist. ;-)
Likewise!
Good point, done.
Good point -- I hadn't even considered CPU hotplug, so got very lucky.
Good point, reworded.
Hmmm... Why do we need "self"? Because synchronize_rcu_fgp() blocks,
it had jolly well better not be within a read-side critical section.
So, what am I missing here?
Same as above. ;-)
Yeah, I never was all that good at disguising code anyway. But I did
keep a couple of changes. ;-)
Updated patch below.
Thanx, Paul
------------------------------------------------------------------------
And here is a crude second cut. Untested, probably does not even compile.
Straight conversion of Mathieu Desnoyers's user-space RCU implementation
at git://lttng.org/userspace-rcu.git to the kernel (and yes, I did help
a little, but he must bear the bulk of the guilt). Pick on srcu.h
and srcu.c out of sheer laziness. User-space testing gives deep
sub-microsecond grace-period latencies, so should be fast enough, at
least if you don't mind two smp_call_function() invocations per grace
period and spinning on each instance of a per-CPU variable.
Again, I believe per-CPU locking should work fine for the netfilter
counters, but I guess "friends don't let friends use hashed locks".
(I would not know for sure, never having used them myself, except of
course to protect hash tables.)
Most definitely -not- for inclusion at this point. Next step is to hack
up the relevant rcutorture code and watch it explode on contact. ;-)
Changes since v1:
o Applied Mathieu's feedback.
o Added docbook headers and other comments.
o Added the rcu_fgp_batches_completed API required by rcutorture.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
include/linux/srcu.h | 42 ++++++++++++++++++++++++
kernel/srcu.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 131 insertions(+)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html