read a
write b <<<<<< end of the spinlock protected area
read c
read d
could be reordered as
read a
read d
read c
write b <<<<<<<< end of the spinlock protected area
this is acceptable for a spinlock: the CPU executes additional
instructions, but never _fewer_ instructions, within the protected area.
The only operation which must not happen is that "read a" is executed
_after_ write b, and this doesn't happen.
---------
AFAICS, the rmb() during set_current_state() is still required:
__wait_on_inode()
add_wait_queue();
current->state=TASK_UNINTERRUPTIBLE;
if(inode->i_state & I_LOCK) {
schedule();
without rmb(), current->state=TASK_UNINTERRUPTIBLE would be a normal
write, and thus the following read for inode->i_state could be executed
_before_ setting state -> wake-up is lost.
-- Manfred- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/