[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[altq 72] Re: When a class is delayed (undertime)



Hi Kenjiro.
Sorry for the delay, but I was able to restart working on CBQ just today.

Could you please explain why do you inserded the following code?

> +	tidle = (1 - RM_POWER) * avgidle >> RM_FILTER_GAIN;
> +	TV_ADD_DELTA(nowp, tidle, &cl->undertime_);

Why are you adding (1 - RM_POWER) * avgidle >> RM_FILTER_GAIN ?
What does it means this value?

In this way, the suspension time becomes:

susp_time = nowp + tidle + packet_time + offtime

Why?

Thanks a lot.

	fulvio


> -----Original Message-----
> From: owner-altq@csl.sony.co.jp [mailto:owner-altq@csl.sony.co.jp]On
> Behalf Of Kenjiro Cho
> Sent: Friday, June 18, 1999 1:50 PM
> To: Fulvio Risso
> Cc: altq@csl.sony.co.jp
> Subject: [altq 45] Re: When a class is delayed (undertime)
> 
> 
> 
> Fulvio,
> 
> Today I finally had time to look into the undertime issue.
> I'm now convinced that your suggestion makes sense under a steady
> state.
> 
> CBQ keeps track of a time line of trasmission finish time that is
> skewed by a number of packets in the network card.
> In the current implementation, an overlimit class is suspended until
> it becomes underlimit in the real time.  As a result, the skew is
> added to the packet interval when a suspended class is resumed.
> It makes sense to resume the suspended class earlier by the amount of
> the skew.
> 
> Also, I have found two other minor problems:
>  1. the target idle time should not include the packet transmission
>     time (pkt_time) since it is already added to the finish time (ifnow).
>  2. the undertime should not be cancelled.  (undertime + offtime) will
>     make "avgidle" big enough to send "minburst" packets.
> 
> -Kenjiro
> 
> --- altq_rmclass.c-	Fri Jun 18 17:09:52 1999
> +++ altq_rmclass.c	Fri Jun 18 20:44:57 1999
> @@ -1270,7 +1270,7 @@
>  	int		idle, avgidle, pktlen;
>  	rm_class_t	*cl, *borrowed;
>  	rm_class_t	*borrows;
> -	long 		pkt_time;
> +	long 		pkt_time, tidle;
>  	struct timeval	*nowp;
>  
>  	/*
> @@ -1369,8 +1369,8 @@
>  				avgidle = cl->avgidle_ = cl->minidle_;
>  #endif
>  			/* set next idle to make avgidle 0 */
> -			pkt_time += (1 - RM_POWER) * avgidle >> 
> RM_FILTER_GAIN;
> -			TV_ADD_DELTA(&ifd->ifnow_, pkt_time, 
> &cl->undertime_);
> +			tidle = (1 - RM_POWER) * avgidle >> RM_FILTER_GAIN;
> +			TV_ADD_DELTA(nowp, tidle, &cl->undertime_);
>  			++cl->stats_.over;
>  		} else {
>  			cl->avgidle_ =
> @@ -1511,8 +1511,6 @@
>  	int	t;
>  
>  	cl->stats_.overactions++;
> -	if (TV_LT(&cl->overtime_, &cl->ifdat_->ifnow_))
> -		cl->overtime_ = cl->ifdat_->ifnow_;
>  	TV_DELTA(&cl->undertime_, &cl->overtime_, delay);
>  #ifndef BORROW_OFFTIME
>  	delay += cl->offtime_;
> @@ -1532,10 +1530,6 @@
>  #else /* BORROW_OFFTIME */
>  		TV_ADD_DELTA(&cl->undertime_, cl->offtime_, 
> &cl->undertime_);
>  #endif /* BORROW_OFFTIME */
> -		/* this code cancels the undertime set in 
> rmc_update_class_util. */
> -		TV_ADD_DELTA(&cl->undertime_,
> -			     -((1 - RM_POWER) * cl->avgidle_) >> 
> RM_FILTER_GAIN,
> -			     &cl->undertime_);
>  		cl->sleeping_ = 1;
>  		cl->stats_.delays++;
>  
>