aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/RCU/whatisRCU.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/RCU/whatisRCU.txt')
-rw-r--r--Documentation/RCU/whatisRCU.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
index 4f41a60e5111..318df44259b3 100644
--- a/Documentation/RCU/whatisRCU.txt
+++ b/Documentation/RCU/whatisRCU.txt
@@ -687,8 +687,9 @@ diff shows how closely related RCU and reader-writer locking can be.
687 + spin_lock(&listmutex); 687 + spin_lock(&listmutex);
688 list_for_each_entry(p, head, lp) { 688 list_for_each_entry(p, head, lp) {
689 if (p->key == key) { 689 if (p->key == key) {
690 list_del(&p->list); 690 - list_del(&p->list);
691 - write_unlock(&listmutex); 691 - write_unlock(&listmutex);
692 + list_del_rcu(&p->list);
692 + spin_unlock(&listmutex); 693 + spin_unlock(&listmutex);
693 + synchronize_rcu(); 694 + synchronize_rcu();
694 kfree(p); 695 kfree(p);
@@ -736,7 +737,7 @@ Or, for those who prefer a side-by-side listing:
736 5 write_lock(&listmutex); 5 spin_lock(&listmutex); 737 5 write_lock(&listmutex); 5 spin_lock(&listmutex);
737 6 list_for_each_entry(p, head, lp) { 6 list_for_each_entry(p, head, lp) { 738 6 list_for_each_entry(p, head, lp) { 6 list_for_each_entry(p, head, lp) {
738 7 if (p->key == key) { 7 if (p->key == key) { 739 7 if (p->key == key) { 7 if (p->key == key) {
739 8 list_del(&p->list); 8 list_del(&p->list); 740 8 list_del(&p->list); 8 list_del_rcu(&p->list);
740 9 write_unlock(&listmutex); 9 spin_unlock(&listmutex); 741 9 write_unlock(&listmutex); 9 spin_unlock(&listmutex);
741 10 synchronize_rcu(); 742 10 synchronize_rcu();
74210 kfree(p); 11 kfree(p); 74310 kfree(p); 11 kfree(p);