xen subdir deprecated
[linux-2.6.git] / kernel / vserver / sched_init.h
1
2 static inline void vx_info_init_sched(struct _vx_sched *sched)
3 {
4         static struct lock_class_key tokens_lock_key;
5         int i;
6
7         /* scheduling; hard code starting values as constants */
8         sched->fill_rate        = 1;
9         sched->interval         = 4;
10         sched->tokens_min       = HZ >> 4;
11         sched->tokens_max       = HZ >> 1;
12         sched->jiffies          = jiffies;
13         sched->tokens_lock      = SPIN_LOCK_UNLOCKED;
14
15 #ifdef CONFIG_VSERVER_ACB_SCHED
16         /* We can't set the "real" token count here because we don't have
17          * access to the vx_info struct.  Do it later... */
18         for (i = 0; i < SCH_NUM_CLASSES; i++) {
19             sched->state[i] = SCH_UNINITIALIZED;
20         }
21 #endif
22
23         lockdep_set_class(&sched->tokens_lock, &tokens_lock_key);
24
25         atomic_set(&sched->tokens, HZ >> 2);
26         sched->cpus_allowed     = CPU_MASK_ALL;
27         sched->priority_bias    = 0;
28         sched->vavavoom         = 0;
29
30         for_each_possible_cpu(i) {
31                 sched->cpu[i].user_ticks        = 0;
32                 sched->cpu[i].sys_ticks         = 0;
33                 sched->cpu[i].hold_ticks        = 0;
34         }
35 }
36
37 static inline void vx_info_exit_sched(struct _vx_sched *sched)
38 {
39         return;
40 }
41