码迷,mamicode.com
首页 > 其他好文 > 详细

calc_load_tasks

时间:2017-12-11 11:14:49      阅读:347      评论:0      收藏:0      [点我收藏+]

标签:task   ada   alc   str   return   atomic   upd   glob   load   

//4.14.2
//sched/loadavg.c 
/* Variables and functions for calc_load */
atomic_long_t calc_load_tasks;
unsigned long calc_load_update;
unsigned long avenrun[3];

/*
* Called from scheduler_tick() to periodically update this CPU‘s * active count. */ void calc_global_load_tick(struct rq *this_rq) { long delta; if (time_before(jiffies, this_rq->calc_load_update)) return; delta = calc_load_fold_active(this_rq, 0); if (delta) atomic_long_add(delta, &calc_load_tasks); this_rq->calc_load_update += LOAD_FREQ; } long calc_load_fold_active(struct rq *this_rq, long adjust) { long nr_active, delta = 0; nr_active = this_rq->nr_running - adjust; nr_active += (long)this_rq->nr_uninterruptible; if (nr_active != this_rq->calc_load_active) { delta = nr_active - this_rq->calc_load_active; this_rq->calc_load_active = nr_active; } return delta; }

 

calc_load_tasks

标签:task   ada   alc   str   return   atomic   upd   glob   load   

原文地址:http://www.cnblogs.com/fluray/p/8021572.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!