Shared memory consistency in Linux

"Andrew Perepechko" <[email protected]>
Newsgroups gmane.linux.smp
Message-ID <[email protected]>
Is there some simple rule that can help in exploring if some kernel routine provides read or write barrier (or both)?

I can see in the kernel source that it is correct to omit explicit memory barrier in the following example:

code A:

event = 1;
mb(); // Unnecessary
wake_up(wq);

code B:

wait_event(&wq, event == 1);


This feature (write barrier presence in wake_up) is not documented in the kernel code, can it get changed in the future? 

Which kernel routines (except this one) provide memory barriers (and will provide in the future), especially locking routines? 

I've read "Unreliable Guide to Locking" by R.Russell, but i'd like some reliable (and more complete) guide.
-
To unsubscribe from this list: send the line "unsubscribe linux-smp" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.