lkml.org 
[lkml]   [2007]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2007-07-24 19:23    [W:0.083 / U:1.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site