Are you sure that the compiler knows that post_send() has side effects? On Fri, Jan 31, 2014 at 8:28 AM, Hannes Weisbach <hannes.weisbach@xxxxxxxxxxxxx> wrote: > > Am 30.01.2014 um 22:36 schrieb Anuj Kalia <anujkaliaiitd@xxxxxxxxx>: > >> Hannes, >> >> Have you tried marking the memory that is being read as "volatile"? > Thanks for the suggestion, but I don't think that this solves the > problem, because when I do: > > memset(...); > rdma_post_read(...); > /* wait */ > memcmp(...); > > The compiler may not optimize across rdma_post_read() (or rather > ibv_post_send() and finally ioctl()), because these function may have > side-effects (which they do). > Anyway, I implemented a little helper memcmpv(volatile unsigned char * > s1, volatile unsiged char * s2, size_t size) to compare the memory as > volatile, but the memory still has the preset 0x55 instead of the > contents of the remote memory. > May that memset() be still in the cache, so that the memory accesses > of the CPU hit the cache instead of main memory? I can't imagine the > cache isn't invalidated on reception of remote data. > > Best regards, > Hannes -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html