不要自己动手加汇编指令,用wmb() 或是 mmiomb()就可以了
linux内核的Documentation中有DeviceIOBook里面有说明 (make htmldocs)
此外你真的很清楚那几条指令的含义吗?连isync都用上了,这个跟指令没有任何关系的,isync的代价很高,用mbar/msync应该就够了。
- Wang
2009/7/9 higur <hi...@163.com>:
try ioremap_nocache.
If not, I remember linux supports several functions operate on cache,
something like flush***cache. Not clear, google it.
> 但是还有问题。
> 我们是一个操作系统,同时的上下文很多。那么清了cache会对其它的上下文有影响。
It is safe for other progress/threads. Don't worry about it. :-)
> 那么如何只影响我一个kthread,而不影响其他的
> 程序又如何操作呢???大家有思路么?谢谢。。。。^_^....
>
>
Thanks
Xiao
理论上说,这个函数应该帮你做了所有你需要的工作。应该已经满足了你的需求。
除非因为体系结构的原因,TLB/MMU 对 mapped mem 失去了‘完全’的控制。(Fix
me), :)
>
> If not, I remember linux supports several functions operate on cache,
> something like flush***cache. Not clear, google it.
>
Try:
grep -rnE "cache_*flush" <kernel source>
>
> > 但是还有问题。
> > 我们是一个操作系统,同时的上下文很多。那么清了cache会对其它的上下文有影响。
> It is safe for other progress/threads. Don't worry about it. :-)
他担心的应该是 cache flush 对其他的部分的“效能”影响,而不是“功能”影响。
-MJ
>
> > 那么如何只影响我一个kthread,而不影响其他的
> > 程序又如何操作呢???大家有思路么?谢谢。。。。^_^....
> >
> >
> Thanks
> Xiao
>