About this list Date view Thread view Subject view Author view Attachment view

From: Herbert Poetzl (herbert_at_13thfloor.at)
Date: Mon 05 Sep 2005 - 16:15:20 BST


On Mon, Sep 05, 2005 at 08:53:55PM +1200, Sam Vilain wrote:
> The attached patch fixes a bug when you use "vsched" on a running
> vserver on amd64, in which the high 32 bits of various scheduling
> parameters could be filled with garbage, causing tokens to be allocated
> at vastly incorrect rates.

how and why? any details? sounds like a
gcc bug to me (at first glance, maybe I'm wrong)

> Patch is against -vs2.0

> diff -ur linux-2.6.12.5-vs2.0.orig/include/linux/vserver/sched_def.h linux-2.6.12.5-vs2.0/include/linux/vserver/sched_def.h
> --- linux-2.6.12.5-vs2.0.orig/include/linux/vserver/sched_def.h 2005-09-05 19:05:11.000000000 +1200
> +++ linux-2.6.12.5-vs2.0/include/linux/vserver/sched_def.h 2005-09-05 19:03:11.000000000 +1200
> @@ -21,10 +21,10 @@
> 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_min; /* Limit: minimum for unhold */
> - int tokens_max; /* Limit: no more than N tokens */
> + uint32_t fill_rate; /* Fill rate: add X tokens... */
> + uint32_t interval; /* Divisor: per Y jiffies */
> + uint32_t tokens_min; /* Limit: minimum for unhold */
> + uint32_t tokens_max; /* Limit: no more than N tokens */
> uint32_t jiffies; /* last time accounted */

ahem, that's the in-kernel structure used to
store the values, the userspace API uses

struct vcmd_set_sched_v3 {
        uint32_t set_mask;
        int32_t fill_rate;
        int32_t interval;
        int32_t tokens;
        int32_t tokens_min;
        int32_t tokens_max;
        int32_t priority_bias;
};

so, if that affects the kernel somehow, the
issue must be somewhere else, no?

so I consider this a bandaid at most ...
will look into the code soon ...

thanks,
Herbert

> int priority_bias; /* bias offset for priority */
> diff -ur linux-2.6.12.5-vs2.0.orig/kernel/vserver/sched.c linux-2.6.12.5-vs2.0/kernel/vserver/sched.c
> --- linux-2.6.12.5-vs2.0.orig/kernel/vserver/sched.c 2005-09-05 19:05:11.000000000 +1200
> +++ linux-2.6.12.5-vs2.0/kernel/vserver/sched.c 2005-09-05 18:03:45.000000000 +1200
> @@ -30,7 +30,7 @@
> */
> int vx_tokens_recalc(struct vx_info *vxi)
> {
> - long delta, tokens = 0;
> + uint32_t delta, tokens = 0;
>
> if (vx_info_flags(vxi, VXF_SCHED_PAUSE, 0))
> /* we are paused */

> _______________________________________________
> Vserver mailing list
> Vserver_at_list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver

_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 05 Sep 2005 - 16:15:40 BST by hypermail 2.1.3