2009년 11월 13일 금요일

sched.h(struct runqueue)

커널 버전  2.6.20.18  에서 sched.h

 205 struct rq {
 206     spinlock_t lock; // 프로세서전환시에 락을 걸기위해서 사용
 207
 208     /*
 209      * nr_running and cpu_load should be in the same cacheline because
 210      * remote CPUs use both these fields when doing load calculation.
 211      */
 212     unsigned long nr_running;
 213     unsigned long raw_weighted_load;
 214 #ifdef CONFIG_SMP
 215     unsigned long cpu_load[3];
 216 #endif
 217     unsigned long long nr_switches;
 218
 219     /*
 220      * This is part of a global counter where only the total sum
 221      * over all CPUs matters. A task can increase this counter on
 222      * one CPU and if it got migrated afterwards it may decrease
 223      * it on another CPU. Always updated under the runqueue lock:
 224      */
 225     unsigned long nr_uninterruptible;
 226
 227     unsigned long expired_timestamp;
 228     /* Cached timestamp set by update_cpu_clock() */
 229     unsigned long long most_recent_timestamp;
 230     struct task_struct *curr, *idle;
 231     unsigned long next_balance;
 232     struct mm_struct *prev_mm;
 233     struct prio_array *active, *expired, arrays[2];
 234     int best_expired_prio;
 235     atomic_t nr_iowait;
 236
 237 #ifdef CONFIG_SMP
 238     struct sched_domain *sd;
 239
 240     /* For active balancing */
 241     int active_balance;
 242     int push_cpu;
 243     int cpu;        /* cpu of this runqueue */
 244
 245     struct task_struct *migration_thread;
 246     struct list_head migration_queue;
 247 #endif
 248
 249 #ifdef CONFIG_SCHEDSTATS
 250     /* latency stats */
 251     struct sched_info rq_sched_info;
 252
 253     /* sys_sched_yield() stats */
 254     unsigned long yld_exp_empty;
 255     unsigned long yld_act_empty;
 256     unsigned long yld_both_empty;
 257     unsigned long yld_cnt;
 258
 259     /* schedule() stats */
 260     unsigned long sched_switch;
 261     unsigned long sched_cnt;
 262     unsigned long sched_goidle;
 263
 264     /* try_to_wake_up() stats */
 265     unsigned long ttwu_cnt;

 266     unsigned long ttwu_local;
 267 #endif
 268     struct lock_class_key rq_lock_key;
 269 };

                    

댓글 없음:

댓글 쓰기