Re: tcptrace-bugs Re: patch included: big performance improvement for long-lived conns w/ loss PART 2

From: Manikantan Ramadas (mramadas@masaka.cs.ohiou.edu)
Date: 09/21/05


Date: Wed, 21 Sep 2005 00:38:58 -0400
From: Manikantan Ramadas <mramadas@masaka.cs.ohiou.edu>
Subject: Re: tcptrace-bugs Re: patch included: big performance improvement for long-lived conns w/ loss PART 2
Message-ID: <20050921043858.GA16429@masaka.cs.ohiou.edu>


Hi Mike,

   Thanks for sending this patch, and sorry for letting this mail stay in my
INBOX for this long. The idea here seems reasonable. I shall
patch it in soon unless I hear any objections from my fellow tcptrace
maintainers here.

Thanks,
Mani.

On Sun, Sep 04, 2005 at 12:02:23AM -0700, Mike Lowell wrote:

> diff -ur tcptrace-6.6.7-orig/rexmit.c tcptrace-6.6.7/rexmit.c
> --- tcptrace-6.6.7-orig/rexmit.c 2003-11-19 06:38:05.000000000 -0800
> +++ tcptrace-6.6.7/rexmit.c 2005-09-03 23:30:25.000000000 -0700
> @@ -173,13 +173,28 @@
> int rexlen = 0;
> Bool split = FALSE;
>
> - /* check each segment in the segment list */
> - pseg = pquad->seglist_head;
> -
> /* (optimize expected case, it just goes at the end) */
> if (pquad->seglist_tail &&
> (thisseg_firstbyte > pquad->seglist_tail->seq_lastbyte))
> - pseg = NULL;
> + goto ADDSEG_END;
> +
> + /* Optimize the most likely case of the segment being near the end *
> + * Can't just perform the entire function backwards because of the *
> + * rtt_retrans() and *pout_order detection logic, but instead we *
> + * can start the normal forward-looking logic near the right place *
> + * by searching for a good starting place from the tail backwards */
> +
> + for (pseg = pquad->seglist_tail;
> + pseg != NULL &&
> + thisseg_firstbyte <= pseg->seq_firstbyte;
> + pseg = pseg->prev);
> +
> + /* seglist is either empty or thisseg_ goes at the beginning *
> + * my profiling suggests it's not worthwhile to optimize for *
> + * this as a special-case */
> + if (pseg == NULL)
> + pseg = pquad->seglist_head;
> +
> for (; pseg != NULL; pseg = pseg->next) {
> if (thisseg_firstbyte > pseg->seq_lastbyte) {
> /* goes beyond this one */
> @@ -239,6 +254,7 @@
> len = thisseg_lastbyte - thisseg_firstbyte + 1;
> }
> }
> +ADDSEG_END:
>
>
> /* if we got to the end, then it doesn't go BEFORE anybody, */
> @@ -780,7 +796,7 @@
> quadrant *pquad = whichquad(ptcb->ss,s);
> segment *pseg;
>
> - for (pseg = pquad->seglist_head; pseg != NULL; pseg = pseg->next) {
> + for (pseg = pquad->seglist_tail; pseg != NULL; pseg = pseg->prev) {
> if (s == (pseg->seq_lastbyte+1)) {
> if (pseg->acked < 4) return TRUE;
> else return FALSE;

-- 
"'Beauty is truth, truth beauty,'--that is all
  Ye know on earth, and all ye need to know." - John Keats
____________________________________________________________________
  
* Manikantan Ramadas * IRG, OU * http://irg.cs.ohiou.edu/~mramadas *
____________________________________________________________________




This archive was generated by hypermail 2.1.7 : 09/21/05 EDT