On Thu, Aug 16, 2007 at 11:54:44AM +0200, Stefan Richter wrote: > > One example was discussed here earlier: The for (;;) loop in > nodemgr_host_thread. There an msleep_interruptible implicitly acted as > barrier (at the moment because it's in a different translation unit; if > it were the same, then because it hopefully has own barriers). So that > happens to work, although such an implicit barrier is bad style: Better > enforce the desired behaviour (== guaranteed load operation) *explicitly*.
Hmm, it's not bad style at all. Let's assume that everything is in the same scope. Such a loop must either call a function that busy-waits, which should always have a cpu_relax or something equivalent, or it'll call a function that schedules away which immediately invalidates any values the compiler might have cached for the atomic_read. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html