[lkml]   [2001]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: On "Unreliable Locking Guide" bug ?
In message <> you write:
> Hi Paul,
> I am reviewing your "Unreliable Locking Guide" from linux 2.4 and just
> wonder about the
> section on "Avoiding Locks: Read and Write". The two lines of code
> new->next = i-> next;
> i->next = new;

Hi John,

Yes, there is of course a lock against other list
manipulations. I've attached a patch to make this clear..


--- linux-2.4.0-official/Documentation/DocBook/kernel-locking.tmpl.~1~ Sat Dec 30 09:07:19 2000
+++ linux-2.4.0-official/Documentation/DocBook/kernel-locking.tmpl Wed Feb 14 15:33:36 2001
@@ -720,7 +720,8 @@
halves without a lock. Depending on their exact timing, they
would either see the new element in the list with a valid
<structfield>next</structfield> pointer, or it would not be in the
- list yet.
+ list yet. A lock is still required against other CPUs inserting
+ or deleting from the list, of course.

Premature optmztion is rt of all evl. --DK
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-03-22 13:14    [W:0.025 / U:1.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site