aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/srcu.h
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-10-04 05:17:04 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 10:55:30 -0400
commiteabc069401bcf45bcc3f19e643017bf761780aa8 (patch)
tree1175b8bed2d88cc9f437edbc239d7681f13b8a7d /include/linux/srcu.h
parentb2896d2e75c87ea6a842c088db730b03c91db737 (diff)
[PATCH] Add SRCU-based notifier chains
This patch (as751) adds a new type of notifier chain, based on the SRCU (Sleepable Read-Copy Update) primitives recently added to the kernel. An SRCU notifier chain is much like a blocking notifier chain, in that it must be called in process context and its callout routines are allowed to sleep. The difference is that the chain's links are protected by the SRCU mechanism rather than by an rw-semaphore, so calling the chain has extremely low overhead: no memory barriers and no cache-line bouncing. On the other hand, unregistering from the chain is expensive and the chain head requires special runtime initialization (plus cleanup if it is to be deallocated). SRCU notifiers are appropriate for notifiers that will be called very frequently and for which unregistration occurs very seldom. The proposed "task notifier" scheme qualifies, as may some of the network notifiers. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Paul E. McKenney <paulmck@us.ibm.com> Acked-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/srcu.h')
-rw-r--r--include/linux/srcu.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 947fdab2ddb0..8a45367b5f3a 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -24,6 +24,9 @@
24 * 24 *
25 */ 25 */
26 26
27#ifndef _LINUX_SRCU_H
28#define _LINUX_SRCU_H
29
27struct srcu_struct_array { 30struct srcu_struct_array {
28 int c[2]; 31 int c[2];
29}; 32};
@@ -46,4 +49,5 @@ int srcu_read_lock(struct srcu_struct *sp) __acquires(sp);
46void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); 49void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp);
47void synchronize_srcu(struct srcu_struct *sp); 50void synchronize_srcu(struct srcu_struct *sp);
48long srcu_batches_completed(struct srcu_struct *sp); 51long srcu_batches_completed(struct srcu_struct *sp);
49void cleanup_srcu_struct(struct srcu_struct *sp); 52
53#endif