> #define preempt_disable() barrier()
> ......
> #define preempt_enable() barrier()

  Let me try answering this with a limited knowledge I have about barriers.
barrier() essentially was added so that compiler reordering does not happen.

  In the code above, since the compiler does not know/understand the
specialty of preempt_[enable/disable], the compiler might decide to change
the ordering.

 In this case, where the code is disabling/enabling preemption, barrier() tells
the compiler that it can't move stuff around.

 I hope this helps.

- Doug

_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to