This is the correct behaviour the code must follow.
Even if it has just stored the value in foo ( 3 ) and even it can think that
the value is %edx is the last one, the volatile keyword force a reload in 5.
The step 4 is not clear for me !
IMVHO doing a jiffies++ or (*(unsigned long *)&jiffies)++ is exactly the same
thing in this case.
I mean that :
incl jiffies
or
movl jiffies, %eax
incl %eax
movl %eax, jiffies
does not introduce worse issues in SMP.
Sure the volatile keyword avoid the compiler to optimize :
movl jiffies, %eax
incl %eax
...
movl %eax, jiffies
As a general rule I suggest to introduce any tricks that can solve speed or
code optimization issues where there's the need, avoiding them in caseless
situations.
Cheers,
Davide.
-- "Debian, the freedom in freedom."
- 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/