Re: [PATCH] "volatile considered harmful", take 3



On 5/11/07, Jonathan Corbet <corbet@xxxxxxx> wrote:
Here's another version of the volatile document. Once again, I've tried
to address all of the comments. There haven't really been any recent
comments addressing the correctness of the document; people have been
more concerned with how it's expressed. I'm glad to see files in
Documentation/ held to a high standard of writing, but, unless somebody
has a factual issue this time around I would like to declare Mission
Accomplished and move on.

The document looks good, but whether:

+ - Pointers to data structures in coherent memory which might be modified
+ by I/O devices can, sometimes, legitimately be volatile. A ring buffer
+ used by a network adapter, where that adapter changes pointers to
+ indicate which descriptors have been processed, is an example of this
+ type of situation.

is a legitimate use case for volatile is still not clear to me (I
agree with Alan's
comment in a previous thread that this seems to be a case where a memory
barrier would be applicable^Wbetter, actually). I could be wrong here, so
would be nice if Peter explains why volatile is legitimate here.

Otherwise, it's fine with me.

Thanks,
Satyam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH] "volatile considered harmful", take 3
    ... by I/O devices can, sometimes, legitimately be volatile. ... where that adapter changes pointers to ... would be nice if Peter explains why volatile is legitimate here. ... invariants across the barrier. ...
    (Linux-Kernel)
  • Re: [PATCH] "volatile considered harmful", take 3
    ... by I/O devices can, sometimes, legitimately be volatile. ... used by a network adapter, where that adapter changes pointers to ... is a legitimate use case for volatile is still not clear to me (I ...
    (Linux-Kernel)
  • Re: [RFC/PATCH] doc: volatile considered evil
    ... it is legitimate to use for inline assembly. ... Volatile does one thing - prohibits C compiler from optimizing ... construct modifies memory that is neither listed in inputs nor outputs to ... the warning that was proposed for addition to CodingStyle should be ...
    (Linux-Kernel)
  • Re: [RFC/PATCH] doc: volatile considered evil
    ... it is legitimate to use for inline assembly. ... Volatile does one thing - prohibits C compiler from optimizing ... construct modifies memory that is neither listed in inputs nor outputs to ... the warning that was proposed for addition to CodingStyle should be ...
    (Linux-Kernel)
  • Re: [PATCH] "volatile considered harmful", take 3
    ... H. Peter Anvin wrote: ... >> + used by a network adapter, where that adapter changes pointers to ... > would be nice if Peter explains why volatile is legitimate here. ... invariants across the barrier. ...
    (Linux-Kernel)