[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070510230003.5861c4b9@the-village.bc.nu>
Date: Thu, 10 May 2007 23:00:03 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Jonathan Corbet <corbet@....net>, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, Randy Dunlap <randy.dunlap@...cle.com>
Subject: Re: [PATCH] "volatile considered harmful" document
> In Ethernet drivers, for example, it is common for the network card to
> maintain a pointer in host memory the the latest descriptor written; you
> will generally have a loop of the form:
>
> while ((this_pointer = *pointer_ptr) > my_last_pointer) {
> for (pkt = my_last_pointer; pkt < this_pointer; pkt++)
> receeive_packet(pkt);
> my_last_pointer = this_pointer;
> }
>
> pointer_p can then be a volatile pointer into said coherent memory.
True but you can happily use rmb/wmb for this which are clearer and fit
the rest of the Linux model better.
Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists