Look, you're not going to request any kind of black magic over that variable.
You're simply telling the compiler the way it has to ( not ) optimize the code.
This is IMHO a declaration time issue.
Looking at this code :
while (jiffies < ...) {
...
}
the "natural" behaviour that a reader expects is that the "content" of the memory
pointed by jiffied is loaded and compared.
That content, not the content of a register loaded 100 asm instructions before the load.
If you like this code more :
for (;;) {
barrier();
if (jiffies >= ...)
break;
...
}
It's clear that a declaration like :
__locked_access__ struct pio {
int a, b, c;
};
for (;;) {
++a;
if (a > b && c < a)
...
}
sounds a "Bad Thing"(tm) even to me.
- Davide
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/