博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
prefetch
阅读量:2454 次
发布时间:2019-05-10

本文共 1384 字,大约阅读时间需要 4 分钟。

From: Linus Torvalds 
Newsgroups: fa.linux.kernelSubject: Re: [patch] epoll use a single inode ...Date: Wed, 07 Mar 2007 22:58:57 UTCMessage-ID: <>On Wed, 7 Mar 2007, Anton Blanchard wrote:>> Funny you mention this. We found some noticeable ppc64 regressions when> moving the dcache to standard list macros and had to do this to fix it> up:>> static inline void prefetch(const void *x)> {> if (unlikely(!x))> return;>> __asm__ __volatile__ ("dcbt 0,%0" : : "r" (x));> }>> Urgh :)Yeah, I'm not at all surprised. Any implementation of "prefetch" thatdoesn't just turn into a no-op if the TLB entry doesn't exist (which makesthem weaker for *actual* prefetching) will generally have a hard time witha NULL pointer. Exactly because it will try to do a totally unnecessaryTLB fill - and since most CPU's will not cache negative TLB entries, thatunnecessary TLB fill will be done over and over and over again..In general, using software prefetching is just a stupid idea, unless - the prefetch really is very strict (ie for a linked list you do exactly the above kinds of things to make sure that you don't try to prefetch the non-existent end entry)AND - the CPU is stupid (in-order in particular).I think Intel even suggests in their optimization manuals to *not* dosoftware prefetching, because hw can usually simply do better without it. Linus

转载地址:http://onjhb.baihongyu.com/

你可能感兴趣的文章
如何将ApexCharts与Vue.js集成-详细指南
查看>>
计算机编程课程顺序_550月份提供免费的在线编程和计算机科学课程
查看>>
roro cam_现代JavaScript中的优雅图案:RORO
查看>>
framer x使用教程_如何使用Framer Motion将交互式动画和页面过渡添加到Next.js Web应用程序
查看>>
电子邮件传输的内容_电子邮件标题中有什么内容,为什么要关注?
查看>>
华为技术面试编码题_最佳技术编码面试准备书
查看>>
全栈Python Flask教程-建立社交网络
查看>>
react 对象克隆_如何使用React&GraphQL(Dune World Edition)创建全栈Yelp克隆
查看>>
完成平方公式:如何用二次方程完成平方
查看>>
完整的React Router初学者指南(包括Router Hooks)
查看>>
村上春树 开始写作_如何克服对写作的恐惧并找到开始的动力
查看>>
gatsby_如何使用Gatsby和Leaflet创建夏季公路旅行地图绘制应用程序
查看>>
phaser.min.js_如何使用Phaser 3,Express和Socket.IO构建多人纸牌游戏
查看>>
p值 统计学意义_什么是统计意义? P值定义以及如何计算
查看>>
23岁一无所有怎么办_我搬到国外去创业,然后一无所有。
查看>>
gdb -iex_如何使用IEX Cloud,Matplotlib和AWS在Python中创建自动更新数据可视化
查看>>
craigslist_Craigslist,Wikipedia和丰富经济
查看>>
sql子查询示例_SQL更新查询示例说明
查看>>
100个c#初学者编程实例_C#编程:初学者入门
查看>>
c语言中的if语句_If ... C中的其他语句解释
查看>>