Re: [PATCH, RFC] v4 scalable classic RCU implementation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Friday, September 5, 2008 - 4:04 pm

On Fri, Sep 05, 2008 at 12:33:40PM -0700, Andrew Morton wrote:

Thank you very much for looking this over!


CONFIG_RCU_CPU_STALL_DETECTOR it is!  It is sufficiently lightweight
to be included in production systems, and similar mechanisms have proven
their value in my experience.  So no _DEBUG.


Agreed, but note well the quote from above:

	The hierarchical-RCU implementation has been moved to its own
 	"rcutree" set of files.  This allows configuring three different
 	implementations of RCU (CLASSIC_RCU, PREEMPT_RCU, and the new
 	TREE_RCU).  More importantly, it enables easy application of
 	this patch to a wide variety of Linux versions.
 
 	I hope that this implementation can completely replace Classic
 	RCU, but in the meantime, this split makes for easier testing
 	and review.

The idea is to avoid adding another RCU flavour (or flavor, for that
matter), instead replacing Classic RCU.


I agree in principle, but this case is an exception.

Suppose that we have NR_CPUS=1024 on a 4-CPU 64-bit machine.  Since 64^2
is greater than 1024, we end up with a two-level hierarchy, with one
rcu_node structure at the root and 16 rcu_node leaf structures, each
of which takes up a single 128-byte cache line.  There will be two such
structures in the system, one for rcu and one for rcu_bh.

So I do not believe that this will be a problem.

One laptops, this is even less of an issue -- NR_CPUS=8 on my laptop,
which would reduce to a pair rcu_node structures, one for rcu, the other
for rcu_bh.

Making the decision at runtime would bloat the code by much more than the
extra data consumed.  And introduce yet more races between online/offline
and everything else.  Besides, this way I am being bloat-compatible
with DEFINE_PER_CPU().  ;-)


You lost me on this one.  On a 64-bit system, I have 8 bytes each for
lock, qsmask, qsmaskinit, grpmask, and parent, four bytes each for grplo
and grphi, and another byte each for grpnum and level, for a total of
50 bytes for each struct rcu_node, which comes to a single cache line
for most large system.  Given the default CONFIG_RCU_FANOUT=64 and
NR_CPUS=4096, we have a two-level hierarchy with one root rcu_node
structure and 64 leaf rcu_node structures.  This gives a total of
65 cache lines.


Two sets, one for rcu and one for rcu_bh, for a grand total of 130
cache lines.

Now the rcu_data structure is another story, given that it is a
DEFINE_PER_CPU() variable, though it has several hundred other per-CPU
friends in the Linux kernel.


Nope, just copied this from Classic RCU.  Fixed.


Good point, fixed.


Indeed.  They belong in rcutree.c rather than in rcutree.h.  Moved.


Done, on both this and TREE_RCU.


;-)


Hmmm...  Compiles without it OK.  Will let you know how the testing
goes.  ;-)


Fair enough, fixed.


Multi-line-ified.


Removed the "L"s.


Multi-line-ified.


Yes, by dint of the argument being pretty much ignored at the moment.
And it should work OK if they key off of the types.


;-)


Fixed.


;-)

Guess I need to get going on that design document...


Well, the read side is easy -- exactly the same code sequence as for
Classic RCU.  On the update side, this is more of a bug fix for large
numbers of CPUs, where unadorned Classic RCU is said to suffer terminal
lock contention.  I will see what I can come up with, but at the end of
the day, this will need some testing on machines larger than the 128-CPU
systems that I have access to.

							Thanx, Paul
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ..., Paul E. McKenney, (Fri Aug 22, 10:22 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ..., Paul E. McKenney, (Wed Aug 27, 11:28 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ..., Paul E. McKenney, (Wed Aug 27, 11:34 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ..., Paul E. McKenney, (Sat Aug 30, 12:38 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ..., Paul E. McKenney, (Sun Aug 31, 10:20 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ..., Paul E. McKenney, (Sun Aug 31, 10:55 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ..., Paul E. McKenney, (Sun Aug 31, 12:23 pm)
[PATCH, RFC] v4 scalable classic RCU implementation, Paul E. McKenney, (Fri Sep 5, 8:29 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Andrew Morton, (Fri Sep 5, 12:33 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Paul E. McKenney, (Fri Sep 5, 4:04 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Andrew Morton, (Fri Sep 5, 4:52 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Paul E. McKenney, (Fri Sep 5, 9:16 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Manfred Spraul, (Sat Sep 6, 9:37 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Paul E. McKenney, (Sun Sep 7, 10:25 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Paul E. McKenney, (Mon Sep 15, 9:02 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Manfred Spraul, (Tue Sep 16, 9:52 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Paul E. McKenney, (Tue Sep 16, 10:30 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Manfred Spraul, (Tue Sep 16, 10:48 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Paul E. McKenney, (Tue Sep 16, 11:22 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Manfred Spraul, (Sun Sep 21, 4:09 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation, Paul E. McKenney, (Sun Sep 21, 2:14 pm)
[PATCH, RFC] v6 scalable classic RCU implementation, Paul E. McKenney, (Tue Sep 23, 4:53 pm)
Re: [PATCH, RFC] v6 scalable classic RCU implementation, Ingo Molnar, (Thu Sep 25, 12:26 am)
Re: [PATCH, RFC] v6 scalable classic RCU implementation, Ingo Molnar, (Thu Sep 25, 12:29 am)
Re: [PATCH, RFC] v6 scalable classic RCU implementation, Paul E. McKenney, (Thu Sep 25, 7:05 am)
Re: [PATCH, RFC] v6 scalable classic RCU implementation, Paul E. McKenney, (Thu Sep 25, 7:18 am)
[PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Fri Oct 10, 9:09 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Manfred Spraul, (Sun Oct 12, 8:52 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Sun Oct 12, 3:46 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Manfred Spraul, (Mon Oct 13, 11:03 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Tue Oct 14, 6:11 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Manfred Spraul, (Wed Oct 15, 1:13 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Wed Oct 15, 8:26 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Gautham R Shenoy, (Fri Oct 17, 1:34 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Gautham R Shenoy, (Fri Oct 17, 8:35 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Fri Oct 17, 8:43 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Fri Oct 17, 8:46 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Manfred Spraul, (Wed Oct 22, 11:41 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Wed Oct 22, 2:02 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Manfred Spraul, (Wed Oct 22, 2:24 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Mon Oct 27, 9:45 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Manfred Spraul, (Mon Oct 27, 12:48 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Mon Oct 27, 4:52 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Manfred Spraul, (Mon Oct 27, 10:30 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Tue Oct 28, 8:17 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Manfred Spraul, (Tue Oct 28, 10:21 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Tue Oct 28, 10:35 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Manfred Spraul, (Sun Nov 2, 1:10 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Mon Nov 3, 1:33 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Manfred Spraul, (Wed Nov 5, 12:48 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Wed Nov 5, 2:27 pm)
[PATCH, RFC] v8 scalable classic RCU implementation, Paul E. McKenney, (Sat Nov 15, 4:20 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation, Paul E. McKenney, (Mon Dec 8, 11:42 am)