Skip to contentSkip to conversation

On "Unreliable Locking Guide" bug ?

DISCUSSION Rusty Russell 1 participant 1 message Feb 14, 2001 1 message not in the archive Documentation

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

In message <[email protected]> you write:

Quoted 8 lines

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..

Thanks!
Rusty.

Documentation/DocBook/kernel-locking.tmpl renamed from Documentation/DocBook/kernel-locking.tmpl.~1~ +2 -1
@@ -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.
     </para>
 
     <para>

--
Premature optmztion is rt of all evl. --DK