Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82a854ec authored by Urs Thuermann's avatar Urs Thuermann Committed by Linus Torvalds
Browse files

[PATCH] RCU Documentation fix



Updater should use _rcu variant of list_del().

Signed-off-by: default avatarUrs Thuermann <urs@isnogud.escape.de>
Acked-by: default avatar"Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1454aed9
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -687,8 +687,9 @@ diff shows how closely related RCU and reader-writer locking can be.
	+	spin_lock(&listmutex);
	+	spin_lock(&listmutex);
		list_for_each_entry(p, head, lp) {
		list_for_each_entry(p, head, lp) {
			if (p->key == key) {
			if (p->key == key) {
				list_del(&p->list);
	-			list_del(&p->list);
	-			write_unlock(&listmutex);
	-			write_unlock(&listmutex);
	+			list_del_rcu(&p->list);
	+			spin_unlock(&listmutex);
	+			spin_unlock(&listmutex);
	+			synchronize_rcu();
	+			synchronize_rcu();
				kfree(p);
				kfree(p);
@@ -736,7 +737,7 @@ Or, for those who prefer a side-by-side listing:
 5   write_lock(&listmutex);            5   spin_lock(&listmutex);
 5   write_lock(&listmutex);            5   spin_lock(&listmutex);
 6   list_for_each_entry(p, head, lp) { 6   list_for_each_entry(p, head, lp) {
 6   list_for_each_entry(p, head, lp) { 6   list_for_each_entry(p, head, lp) {
 7     if (p->key == key) {             7     if (p->key == key) {
 7     if (p->key == key) {             7     if (p->key == key) {
 8       list_del(&p->list);            8       list_del(&p->list);
 8       list_del(&p->list);            8       list_del_rcu(&p->list);
 9       write_unlock(&listmutex);      9       spin_unlock(&listmutex);
 9       write_unlock(&listmutex);      9       spin_unlock(&listmutex);
                                       10       synchronize_rcu();
                                       10       synchronize_rcu();
10       kfree(p);                     11       kfree(p);
10       kfree(p);                     11       kfree(p);