[openib-general] [PATCH] use mmiowb after doorbell ring

Michael S. Tsirkin mst at mellanox.co.il
Tue Oct 17 14:42:18 PDT 2006


Quoting r. Roland Dreier <rdreier at cisco.com>:
> But of course not all x86 processors
> support lfence/mfence which leads to some ugly issues of how to handle
> this

lfence seems to be part of SSE2,
and I don't think we really need sfence/mfence.
We can just require SSE2 support:
http://en.wikipedia.org/wiki/SSE2#CPUs_supporting_SSE2

>
> -- runtime detection seems important but I don't know a good way
> to do that.

Well, at startup we can read /proc/cpuinfo and look for sse2 in the flags: line.
Seems simple enough.

> Probably the best thing would be just to do "lock; addl
> $0,0(%%esp)" by default and add a special compile flag or something to
> enable mfence.

I hope we can do something without compile flags - most people
don't know enough to turn them on, and distros commonly
compile for least common denominator.

-- 
MST




More information about the general mailing list