计算机应用 ›› 2012, Vol. 32 ›› Issue (06): 1713-1716.DOI: 10.3724/SP.J.1087.2012.01713

• 先进计算 • 上一篇    下一篇

多线程环境下基于多预取点的文件预取

刘金,胡创,胡明,龚奕利   

  1. 武汉大学 计算机学院,武汉 430072
  • 收稿日期:2011-11-28 修回日期:2012-01-20 发布日期:2012-06-04 出版日期:2012-06-01
  • 通讯作者: 龚奕利
  • 作者简介:刘金(1991-),男,湖南岳阳人,主要研究方向:分布式计算;〓胡创(1991-),男,湖北黄冈人,主要研究方向:分布式计算;〓胡明(1986-),男,江西奉新人,硕士,主要研究方向:分布式计算;〓龚奕利(1976-),女,浙江平湖人,副教授,博士,主要研究方向:分布式计算、分布式存储。
  • 基金资助:
    国家重大科技专项;国家自然科学基金资助项目

File prefetching with multiple prefetching points in multithreading environment

LIU Jin,HU Chuang,HU Ming,GONG Yi-li   

  1. Computer School, Wuhan University, Wuhan Hubei 430072, China
  • Received:2011-11-28 Revised:2012-01-20 Online:2012-06-04 Published:2012-06-01
  • Contact: GONG Yi-li

摘要: 为解决当前Linux内核的预取算法在多线程情况下出现预取误判的问题,依据多线程环境下进程对磁盘文件的访问特点,提出一种基于多预取点的预取算法。在Linux内核原有的预取算法的基础上,结合多线程环境下应用程序对数据的访问模式,在Linux内核的页面缓存层进行了实现。实验和分析表明,在IOzone单线程测试中,该算法和Linux内核原预取算法性能相当;在多线程测试中,读取相同大小的文件,耗时比Linux内核原预取算法至少少1/3。新算法对于提高I/O并行度,从而提高整个计算机系统并行化很有帮助。

关键词: 多线程, 文件预取, 多预取点, Linux内核

Abstract: To solve the problem that the prefetching algorithm of the current Linux kernel might mistakenly prefetch blocks under the circumstances of multithreading, according to the characteristics of disk file reading in a multi-threaded environment, this paper proposed a file prefetching algorithm with multiple prefetching points. On the basis of the original prefetching algorithm and in combination with the data access patterns of applications, the algorithm was implemented on the page caching layer of Linux. Through the experiments and analysis with IOzone, this proposed algorithm showed comparable performance with the existing algorithm of Linux in the single threaded environment and in a multithreaded one, and it took less time by 1/3 at least. The proposed algorithm helps to improve the I/O parallelism, thereby enhancing the entire computer system parallelism.