Signed-off-by: Jose Renato Santos # HG changeset patch # User root@lsnpsvr3.hpl.hp.com # Date 1170206854 28800 # Node ID 5ea2029835187d20c647fda3f385e5adc97c0611 # Parent 5e8da0663ff863c9de8948b72399e591f34828a2 Add rcu_read_lock() and rcu_read_unlock() definitions in rcupdate.h diff -r 5e8da0663ff8 -r 5ea202983518 xen/include/xen/rcupdate.h --- a/xen/include/xen/rcupdate.h Tue Jan 30 01:23:58 2007 +0000 +++ b/xen/include/xen/rcupdate.h Tue Jan 30 17:27:34 2007 -0800 @@ -112,6 +112,51 @@ int rcu_needs_cpu(int cpu); int rcu_needs_cpu(int cpu); /** + * rcu_read_lock - mark the beginning of an RCU read-side critical section. + * + * When call_rcu() is invoked + * on one CPU while other CPUs are within RCU read-side critical + * sections, invocation of the corresponding RCU callback is deferred + * until after the all the other CPUs exit their critical sections. + * + * Note, however, that RCU callbacks are permitted to run concurrently + * with RCU read-side critical sections. One way that this can happen + * is via the following sequence of events: (1) CPU 0 enters an RCU + * read-side critical section, (2) CPU 1 invokes call_rcu() to register + * an RCU callback, (3) CPU 0 exits the RCU read-side critical section, + * (4) CPU 2 enters a RCU read-side critical section, (5) the RCU + * callback is invoked. This is legal, because the RCU read-side critical + * section that was running concurrently with the call_rcu() (and which + * therefore might be referencing something that the corresponding RCU + * callback would free up) has completed before the corresponding + * RCU callback is invoked. + * + * RCU read-side critical sections may be nested. Any deferred actions + * will be deferred until the outermost RCU read-side critical section + * completes. + * + * It is illegal to block while in an RCU read-side critical section. + */ +#define rcu_read_lock() do { } while (0) + +/** + * rcu_read_unlock - marks the end of an RCU read-side critical section. + * + * See rcu_read_lock() for more information. + */ +#define rcu_read_unlock() do { } while (0) + +/* + * So where is rcu_write_lock()? It does not exist, as there is no + * way for writers to lock out RCU readers. This is a feature, not + * a bug -- this property is what provides RCU's performance benefits. + * Of course, writers must coordinate with each other. The normal + * spinlock primitives work well for this, but any other technique may be + * used as well. RCU does not care how the writers keep out of each + * others' way, as long as they do so. + */ + +/** * rcu_dereference - fetch an RCU-protected pointer in an * RCU read-side critical section. This pointer may later * be safely dereferenced.