Switched to NOHz mode on CPU
来源:互联网 发布:淘宝如何招募分销商 编辑:程序博客网 时间:2024/04/30 21:08
2.6.21内核之前,时钟中断是周期的,即以HZ为频率,系统总是被动的接受时钟中断,然后运行中断处理程序。
实在没有任务可以运行,那么就执行idle,但是时钟中断还是会周期性的打破idle,然后查询有没有需要做的事。如果没继续idle,以往的进程在自己时间片中运行,时钟的定时中断负责监督时间片,系统内核没有主权,一切都在硬件安排下运行。
2.6.22以后,nohz动态设置下一次的中断时间而不是使用系统无条件的默认的HZ中断。
CFS调度器再也不用受制于底层的时钟以及时间片分配特性,linux可以动态设置时间片长短,按照自己的方式来进行调度。
nohz和clocksource和 clock_event_device是时钟以及时钟行为的抽象
struct timer_list :软件时钟,记录了软件时钟到期时间以及到期后要执行的操作。
struct timer_list {
struct list_head entry; //所在的链表
unsigned long expires; //到期时间,以 tick 为单位
void (*function)(unsigned long); //回调函数,到期后执行的操作
unsigned long data; //回调函数的参数
struct tvec_t_base_s *base; //记录该软件时钟所在的 struct tvec_base 变量
#ifdef CONFIG_TIMER_STATS
void *start_site;
char start_comm[16];
int start_pid;
#endif
};
struct tvec_base :管理软件时钟。在 SMP 系统每个 CPU 有一个。
跟踪内核中timer的代码,内核版本2.6.32
//This function runs timers and the timer-tq in bottom half context.
static void run_timer_softirq(struct softirq_action *h)
{
tvec_base_t *base = __get_cpu_var(tvec_bases);
hrtimer_run_queues(); //这里切换到nohz,进而调用tick_nohz_switch_to_nohz(); //如果满足调节,切换到nohz
}
static void tick_nohz_switch_to_nohz(void)
{
printk(KERN_INFO "Switched to NOHz mode on CPU #%d\n",
smp_processor_id());
}
如同内核串口的打印消息了
- Switched to NOHz mode on CPU
- CPU Switches from Kernel mode to User Mode on X86 : When and How?
- switched FragmentPagerAdapter to FragmentStatePagerAdapter-
- 7 reasons I switched back to PHP after 2 years on Rails
- 7 reasons I switched back to PHP after 2 years on Rails
- Switched to Windows Live Writer
- How to Enable USB Debugging Mode on Android
- invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_Run
- Call Android API to control flight mode (Airplane Mode) On / Off
- Why Uber Engineering Switched from Postgres to MySQL
- X86 CPU mode switching
- faster rcnn CPU mode
- How to Get CPU Information on Android Android上获取cpu信息
- How to install oracle by Command Line Interface(CLI) in silent mode on Linux
- [hadoop]How To Install Apache Hadoop Pseudo Distributed Mode on a Single Node
- How to run Android apps in tablet mode on your phone
- How to run program or process on specific CPU cores on Linux(转)
- X86虚拟机,OpenWrt启动时卡在“Switched to clocksource tsc”解决方法
- ActiveMQ 部署及发送接收消息
- elasticsearch2.1 elasticsearch-hadoop安装
- Java泛型详解
- Python爬虫程序学习资料网址
- 欢迎使用CSDN-markdown编辑器
- Switched to NOHz mode on CPU
- awk如何取出它的每一行和某一列的某个元素
- 浅谈UIWebView与JavaScript交互
- select * from user与select u.id,u.name from user的区别?
- Linux下/proc目录简介
- jdom解析xml
- unity3d结合轮廓显示,实现完整的框选目标(附Demo代码)
- cocos2dx如何使用CCFileUtils进行文件查找的
- g++/make: C++程序文件组织模版