当前位置: 技术问答>linux和unix
请问将prefetch这个宏设置为空是否会影响程序?
来源: 互联网 发布时间:2016-12-02
本文导语: 我看到linxu下很多prefetch宏. 并且这个宏针对很多CPU有不同的操作代码. 请问将prefetch这个宏设置为空是否会影响程序? | 本帖最后由 wenxy1 于 2009-12-30 12:26:38 编辑 这些宏是用于支持不同的硬件...
我看到linxu下很多prefetch宏. 并且这个宏针对很多CPU有不同的操作代码.
请问将prefetch这个宏设置为空是否会影响程序?
请问将prefetch这个宏设置为空是否会影响程序?
|
通常我们要配置,.config文件里会定义相应平台的宏. 实际上,用GCC编译时,可以用 -D来定义一个宏.
|
/*
prefetch(x) attempts to pre-emptively get the memory pointed to
by address "x" into the CPU L1 cache.
prefetch(x) should not cause any kind of exception, prefetch(0) is
specifically ok.
prefetch() should be defined by the architecture, if not, the
#define below provides a no-op define.
There are 3 prefetch() macros:
prefetch(x) - prefetches the cacheline at "x" for read
prefetchw(x) - prefetches the cacheline at "x" for write
spin_lock_prefetch(x) - prefetches the spinlock *x for taking
there is also PREFETCH_STRIDE which is the architecure-prefered
"lookahead" size for prefetching streamed operations.
*/
看描述是预取缓存
设置为nop应该没关系
prefetch(x) attempts to pre-emptively get the memory pointed to
by address "x" into the CPU L1 cache.
prefetch(x) should not cause any kind of exception, prefetch(0) is
specifically ok.
prefetch() should be defined by the architecture, if not, the
#define below provides a no-op define.
There are 3 prefetch() macros:
prefetch(x) - prefetches the cacheline at "x" for read
prefetchw(x) - prefetches the cacheline at "x" for write
spin_lock_prefetch(x) - prefetches the spinlock *x for taking
there is also PREFETCH_STRIDE which is the architecure-prefered
"lookahead" size for prefetching streamed operations.
*/
看描述是预取缓存
设置为nop应该没关系