[knem-devel] how to write INT value with KNEM "atomically"

George Bosilca bosilca at eecs.utk.edu
Thu Sep 29 14:15:32 CEST 2011

On Sep 28, 2011, at 01:15 , Brice Goglin wrote:

> Le 27/09/2011 23:05, George Bosilca a écrit :
>> I mean a similar issue can happened to a normal read from a file. If
>> the effective read is done on another thread that the one calling the
>> syscall, just returning from the syscall doesn't means your process
>> memory has been updated yet … The memory has to be flushed by the
>> kernel before returning from a syscall…
> I don't understand here. What do you call a flush? Cache-flush ?

Yes, a cache flush.

> Totally random example: Open-MX doesn't do anything to make
> kernel-written data actually visible to user-space. It just adds a write
> memory barrier to ensure that the notification flag is written at the
> end. But there's no flush and even no return from syscall in most
> receive cases.

But then on what KNEM is different? If you don't have a memory barrier/fence before raising the flag to signal the end of the copy, then upon return from the knem function the user data might be wrong. It look like we already have to have a memory barrier at the end of all the iovec copies in order to have consistent behavior.


> Brice
> _______________________________________________
> knem-devel mailing list
> knem-devel at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/knem-devel

More information about the knem-devel mailing list