lkml.org 
[lkml]   [2007]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] tcp_cubic: use 32 bit math
    On Wed, Mar 07, 2007 at 07:10:47PM -0800, Stephen Hemminger wrote:
    > David Miller wrote:
    > >From: Stephen Hemminger <shemminger@linux-foundation.org>
    > >Date: Wed, 7 Mar 2007 17:07:31 -0800
    > >
    > >
    > >>The basic calculation has to be done in 32 bits to avoid
    > >>doing 64 bit divide by 3. The value x is only 22bits max
    > >>so only need full 64 bits only for x^2.
    > >>
    > >>Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
    > >>
    > >
    > >Applied, thanks Stephen.
    > >
    > >What about Willy Tarreau's supposedly even faster variant?
    > >Or does this incorporate that set of improvements?
    > >
    > That's what this is:
    > x = (2 * x + (uint32_t)div64_64(a, (uint64_t)x*(uint64_t)x)) / 3;

    Confirmed, it's the same. BTW, has someone tested on a 64bit system if
    it brings any difference ?

    Willy

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-03-08 05:23    [W:4.112 / U:0.124 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site