作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2015, Vol. 41 ›› Issue (1): 19-23. doi: 10.3969/j.issn.1000-3428.2015.01.004

• 专栏 • 上一篇    下一篇

一种多核ARM平台下用户态定时器的实现

喻诗祥a,b,c,顾乃杰a,b,c,张旭a,b,c,曹越a,b,c   

  1. 中国科学技术大学 a.计算机科学技术学院; b.安徽省计算与通信软件重点实验室; c.先进技术研究院,合肥 230027
  • 收稿日期:2014-02-21 修回日期:2014-03-20 出版日期:2015-01-15 发布日期:2015-01-16
  • 作者简介:喻诗祥(1990-),男,硕士研究生,主研方向:程序优化技术;顾乃杰(通讯作者),教授、博士生导师;张 旭,博士研究生;曹 越,硕士研究生。
  • 基金资助:

    “核高基”重大专项 (2009ZX01028-002-003-005);高等学校学科创新引智计划基金资助项目(B07033)

Implementation of a User-mode Timer in Multi-core ARM Platform

YU Shixianga,b,c,GU Naijiea,b,c,ZHANG Xua,b,c,CAO Yuea,b,c   

  1. a.School of Computer Science and Technology; b.Anhui Province Key Laboratory of Computing and Communication Software;
    c.Institute of Advanced Technology,University of Science and Technology of China,Hefei 230027,China
  • Received:2014-02-21 Revised:2014-03-20 Online:2015-01-15 Published:2015-01-16

摘要:

在ARM平台下,系统提供的posix-timer误差较大,难以满足实时要求,而且传统的Linux用户态定时器通过系统调用及信号传递的方式向进程提供定时服务,当定时器使用规模较大时,进程会在内核态用户态间频繁切换。针对上述问题,提出并实现一种基于多核ARM平台的新型用户态定时器方案。该方案采用一种新的时间轮数据结构,通过内核态与用户态共享内存等方式向进程提供服务,避免不必要的信号传递,有效地缓解频繁状态切换问题。实验结果表明,该方案保持微秒级的定时精度,定时误差相比posix-timer明显降低。

关键词: Linux用户态, 定时器, 多核, ARM平台, 时间轮, 共享内存

Abstract:

In the ARM platform,the delay of Linux’s posix-timer is big,and can not fit the requirement of real-time system.In addition,traditional Linux user-mode timer provides service to process via system call and signal so that the process switches between kernel-mode and user-mode frequently when the scale of timer being used is very large.To solve these problems,this paper designs and implements a new user-mode timer system in multi-core ARM platform.By using a novel time wheel data structure and providing service to process via sharing memory between kernel-mode and user-mode,the new system avoids the transmission of unnecessary signal,and relives the frequent state switching effectively.Experimental results show that the new system keeps the precision of the timer in micro-second and offers much smaller delay than the posix-timer.

Key words: Linux user-mode, timer, multi-core, ARM platform, time wheel, shared memory

中图分类号: