A fourth case
A fourth case
Posted Mar 29, 2011 21:43 UTC (Tue) by willy (subscriber, #9762)Parent article: The trouble with volatile
I have a device which will DMA entries to a block of memory.
To determine if an entry is new or old, there is a phase bit which is flipped each time around the ring. So I rely on the compiler actually loading from memory, and not using a cached copy of that bit.
To determine if an entry is new or old, there is a phase bit which is flipped each time around the ring. So I rely on the compiler actually loading from memory, and not using a cached copy of that bit.
See uses of volatile in http://git.kernel.org/?p=linux/kernel/git/willy/nvme.git;...
