All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH 4/7] tcp_cubic: fix clock dependency
Date: Mon, 14 Mar 2011 14:21:25 -0700	[thread overview]
Message-ID: <20110314142125.63e84ade@nehalam> (raw)
In-Reply-To: <1300128679.3423.167.camel@edumazet-laptop>

On Mon, 14 Mar 2011 19:51:19 +0100
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Le lundi 14 mars 2011 à 10:52 -0700, Stephen Hemminger a écrit :
> > pièce jointe document texte brut (tcp-cubic-minrtt.patch)
> > The hystart code was written with assumption that HZ=1000.
> > Replace the use of jiffies with bictcp_clock as a millisecond
> > real time clock. 
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> > Reported-by: Lucas Nussbaum <lucas.nussbaum@loria.fr>
> > 
> > --- a/net/ipv4/tcp_cubic.c	2011-03-14 08:19:18.000000000 -0700
> > +++ b/net/ipv4/tcp_cubic.c	2011-03-14 08:22:42.486690594 -0700
> > @@ -88,7 +88,7 @@ struct bictcp {
> >  	u32	last_time;	/* time when updated last_cwnd */
> >  	u32	bic_origin_point;/* origin point of bic function */
> >  	u32	bic_K;		/* time to origin point from the beginning of the current epoch */
> > -	u32	delay_min;	/* min delay */
> > +	u32	delay_min;	/* min delay (msec << 3) */
> >  	u32	epoch_start;	/* beginning of an epoch */
> >  	u32	ack_cnt;	/* number of acks */
> >  	u32	tcp_cwnd;	/* estimated tcp cwnd */
> > @@ -98,7 +98,7 @@ struct bictcp {
> >  	u8	found;		/* the exit point is found? */
> >  	u32	round_start;	/* beginning of each round */
> >  	u32	end_seq;	/* end_seq of the round */
> > -	u32	last_jiffies;	/* last time when the ACK spacing is close */
> > +	u32	last_ack;	/* last time when the ACK spacing is close */
> >  	u32	curr_rtt;	/* the minimum rtt of current round */
> >  };
> >  
> > @@ -119,12 +119,21 @@ static inline void bictcp_reset(struct b
> >  	ca->found = 0;
> >  }
> >  
> > +static inline u32 bictcp_clock(void)
> > +{
> > +#if HZ < 1000
> > +	return ktime_to_ms(ktime_get_real());
> 
> Small point : This can be changed if date/time is changed
> 
> Maybe use monotonic time (aka ktime_get_ts()) ?

I choose get_real() because that is what skb timestamp is using;
both should probably use monotonic clock.


-- 

  reply	other threads:[~2011-03-14 21:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14 17:52 [PATCH 0/7] TCP CUBIC Hystart fixes Stephen Hemminger
2011-03-14 17:52 ` [PATCH 1/7] tcp: fix RTT for quick packets in congestion control Stephen Hemminger
2011-03-14 17:52 ` [PATCH 2/7] tcp_cubic: fix comparison of jiffies Stephen Hemminger
2011-03-14 17:52 ` [PATCH 3/7] tcp_cubic: make ack train delta value a parameter Stephen Hemminger
2011-03-14 17:52 ` [PATCH 4/7] tcp_cubic: fix clock dependency Stephen Hemminger
2011-03-14 18:51   ` Eric Dumazet
2011-03-14 21:21     ` Stephen Hemminger [this message]
2011-03-14 21:37       ` Eric Dumazet
2011-03-14 17:52 ` [PATCH 5/7] tcp_cubic: enable high resolution ack time if needed Stephen Hemminger
2011-03-14 17:52 ` [PATCH 6/7] tcp_cubic: make the delay threshold of HyStart less sensitive Stephen Hemminger
2011-03-14 17:52 ` [PATCH 7/7] tcp_cubic: fix low utilization of CUBIC with HyStart Stephen Hemminger
2011-03-14 22:58 ` [PATCH 0/7] TCP CUBIC Hystart fixes David Miller
2011-03-22 11:34 ` Lucas Nussbaum
2011-03-22 11:35 ` Lucas Nussbaum
2011-03-22 12:05   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110314142125.63e84ade@nehalam \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.