[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-aio
Subject:    Re: Duplicate completion results
From:       Benjamin LaHaise <bcrl () redhat ! com>
Date:       2002-06-19 20:54:30
[Download RAW message or body]

On Wed, Jun 19, 2002 at 01:49:34PM -0700, Stephen Hemminger wrote:
> My suspicion now is that the problem is the fast path code in
> vsys_get_events that runs without barriers or locking.  It is quite
> possible on an SMP for the completion of a read to occur on another CPU
> while in this path.  If so, then tail could be updated the other CPU
> would be working with the old value.  Also tail (and head) are not
> marked volatile so the compiler could be optimizing away the fetch.

There's only one reader for head (unless the program is threaded -- there 
should be a lock in the vsys version, but that can't be the case here).  
The variables don't need to be marked volatile as barrier()s are used 
where needed (gcc generates awful code when volatile is invoked).

		-ben
-- 
"You will be reincarnated as a toad; and you will be much happier."
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic