X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fvserver%2Fsched_def.h;fp=include%2Flinux%2Fvserver%2Fsched_def.h;h=b56ee7b58e4792f6071f43e8fdf054fd5a1b78d2;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=3a577616f8625948bf709e352f5fea0f94263c8f;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/include/linux/vserver/sched_def.h b/include/linux/vserver/sched_def.h index 3a577616f..b56ee7b58 100644 --- a/include/linux/vserver/sched_def.h +++ b/include/linux/vserver/sched_def.h @@ -8,31 +8,61 @@ #include -struct _vx_ticks { - uint64_t user_ticks; /* token tick events */ - uint64_t sys_ticks; /* token tick events */ - uint64_t hold_ticks; /* token ticks paused */ - uint64_t unused[5]; /* cacheline ? */ -}; - /* context sub struct */ struct _vx_sched { - atomic_t tokens; /* number of CPU tokens */ spinlock_t tokens_lock; /* lock for token bucket */ - int fill_rate; /* Fill rate: add X tokens... */ - int interval; /* Divisor: per Y jiffies */ + int tokens; /* number of CPU tokens */ + int fill_rate[2]; /* Fill rate: add X tokens... */ + int interval[2]; /* Divisor: per Y jiffies */ + int tokens_min; /* Limit: minimum for unhold */ + int tokens_max; /* Limit: no more than N tokens */ + + int prio_bias; /* bias offset for priority */ + + unsigned update_mask; /* which features should be updated */ + cpumask_t update; /* CPUs which should update */ +}; + +struct _vx_sched_pc { + int tokens; /* number of CPU tokens */ + int flags; /* bucket flags */ + + int fill_rate[2]; /* Fill rate: add X tokens... */ + int interval[2]; /* Divisor: per Y jiffies */ int tokens_min; /* Limit: minimum for unhold */ int tokens_max; /* Limit: no more than N tokens */ - uint32_t jiffies; /* last time accounted */ - int priority_bias; /* bias offset for priority */ + int prio_bias; /* bias offset for priority */ int vavavoom; /* last calculated vavavoom */ - cpumask_t cpus_allowed; /* cpu mask for context */ + unsigned long norm_time; /* last time accounted */ + unsigned long idle_time; /* non linear time for fair sched */ + unsigned long token_time; /* token time for accounting */ + unsigned long onhold; /* jiffies when put on hold */ - struct _vx_ticks cpu[NR_CPUS]; + uint64_t user_ticks; /* token tick events */ + uint64_t sys_ticks; /* token tick events */ + uint64_t hold_ticks; /* token ticks paused */ }; + +#define VXSF_ONHOLD 0x0001 +#define VXSF_IDLE_TIME 0x0100 + +#ifdef CONFIG_VSERVER_DEBUG + +static inline void __dump_vx_sched(struct _vx_sched *sched) +{ + printk("\t_vx_sched:\n"); + printk("\t tokens: %4d/%4d, %4d/%4d, %4d, %4d\n", + sched->fill_rate[0], sched->interval[0], + sched->fill_rate[1], sched->interval[1], + sched->tokens_min, sched->tokens_max); + printk("\t priority = %4d\n", sched->prio_bias); +} + +#endif + #endif /* _VX_SCHED_DEF_H */