linux cpu占用率
来源:互联网 发布:js radio disabled 编辑:程序博客网 时间:2024/05/20 22:27
cpu 占用率之 wa
wa 占用率为100%时,并不是 cpu 在忙转,此时cpu 一直执行idle 进程。
void __sched io_schedule(void)
{
struct rq *rq = raw_rq();
delayacct_blkio_start();
atomic_inc(&rq->nr_iowait);
current->in_iowait = 1;
schedule();
current->in_iowait = 0;
atomic_dec(&rq->nr_iowait);
delayacct_blkio_end();
}
update_process_times->account_process_tick
void account_process_tick(struct task_struct *p, int user_tick)
{
cputime_t one_jiffy_scaled = cputime_to_scaled(cputime_one_jiffy);
struct rq *rq = this_rq();
if (user_tick)
account_user_time(p, cputime_one_jiffy, one_jiffy_scaled);
else if ((p != rq->idle) || (irq_count() != HARDIRQ_OFFSET))
account_system_time(p, HARDIRQ_OFFSET, cputime_one_jiffy,
one_jiffy_scaled);
else
account_idle_time(cputime_one_jiffy);
}
void account_idle_time(cputime_t cputime)
{
struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
cputime64_t cputime64 = cputime_to_cputime64(cputime);
struct rq *rq = this_rq();
if (atomic_read(&rq->nr_iowait) > 0)
cpustat->iowait = cputime64_add(cpustat->iowait, cputime64);
else
cpustat->idle = cputime64_add(cpustat->idle, cputime64);
}
s3c2410_timer_interrupt ->timer_tick ->
void timer_tick(void)
{
profile_tick(CPU_PROFILING);
do_leds();
do_set_rtc();
write_seqlock(&xtime_lock);
do_timer(1);
write_sequnlock(&xtime_lock);
#ifndef CONFIG_SMP
update_process_times(user_mode(get_irq_regs()));
#endif
}
void do_timer(unsigned long ticks)
{
jiffies_64 += ticks;
update_wall_time();
calc_global_load();
}
cpu 占用率之 ni :
tmp = cputime_to_cputime64(cputime);
if (TASK_NICE(p) > 0)
cpustat->nice = cputime64_add(cpustat->nice, tmp);
else
cpustat->user = cputime64_add(cpustat->user, tmp);
/*
* Convert user-nice values [ -20 ... 0 ... 19 ]
* to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
* and back.
*/
#define NICE_TO_PRIO(nice) (MAX_RT_PRIO + (nice) + 20)
#define PRIO_TO_NICE(prio) ((prio) - MAX_RT_PRIO - 20)
#define TASK_NICE(p) PRIO_TO_NICE((p)->static_prio)
- linux cpu占用率
- linux cpu占用率分析
- Linux 计算进程CPU占用率
- Linux 计算线程CPU占用率
- 编程获取linux cpu占用率,内存占用率以及硬盘使用率
- CPU占用率
- CPU 占用率
- CPU占用率
- Linux CPU占用率的一个困惑
- Unix/Linux获取CPU和内存占用率
- 使用python定时采样linux cpu占用率
- Linux CPU占用率原理与精确度分析
- linux查看虚拟内存和cpu占用率
- Linux下如何查看CPU、内存占用率
- Linux java进程CPU占用率高
- Linux CPU占用率原理与 精确度分析
- 查看linux线程的CPU占用率
- linux 用C语言获得CPU的占用率
- 【数学建模】数学建模(一)——数学模型概述
- Take Action Today
- xcode release 和 debug 模式造成的不同
- 数据结构
- uva 11100 The trip
- linux cpu占用率
- Spring Hello World 实例
- oc - 数组及字符串拼接与分割
- C语言中文网《c,c++,linux,mysql...》
- 从头开始写java--第一篇:为什么要做这个事情
- 《C语言及程序设计》实践项目——数据的输出
- 循环-01. 求整数段和(15)
- Java 访问修饰符
- 基于MFC的ActiveX控件开发