Messages in this thread | | | Date | Tue, 24 Jul 2007 10:20:50 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memory addresses |
| |
On Tue, 24 Jul 2007, Benjamin Herrenschmidt wrote: > > - This "volatile" will allow to pass pointers to volatile data to the > bitops. > > - Most users of "volatile" in the kenrel (except maybe jiffies) are > bogus > > - Thus let's remove it -as a type safety thing- to catch more of those > stupid volatile that shouldn't be ? :-)
Quite frankly, I'd really really rather kill the "volatile" data structures independently. Once that is done, it doesn't really matter any more.
> Besides, as Nick pointed out, it prevents some valid optimizations.
No it doesn't. Not the ones on the functions that just do an inline asm.
The only valid optimization it might break is for "constant_test_bit()", which isn't even using inline asm.
And before we remove that "volatile", we'd better make damn sure that there isn't any driver that does
/* Wait for the command queue to be cleared by DMA */ while (test_bit(...)) ;
or similar.
Yes, it's annoying, but this is a scary and subtle area. And we sadly _have_ had code that does things like that.
Linus - 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/
| |