Return-path: Received: from mail-pa0-f53.google.com ([209.85.220.53]:33103 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932447AbbBJNFS (ORCPT ); Tue, 10 Feb 2015 08:05:18 -0500 Message-ID: <1423573513.28434.16.camel@edumazet-glaptop2.roam.corp.google.com> (sfid-20150210_140536_603094_3943594B) Subject: Re: Throughput regression with `tcp: refine TSO autosizing` From: Eric Dumazet To: Michal Kazior Cc: Neal Cardwell , linux-wireless , Network Development , Eyal Perry Date: Tue, 10 Feb 2015 05:05:13 -0800 In-Reply-To: <1423572896.28434.13.camel@edumazet-glaptop2.roam.corp.google.com> References: <1422537297.21689.15.camel@edumazet-glaptop2.roam.corp.google.com> <1422628835.21689.95.camel@edumazet-glaptop2.roam.corp.google.com> <1422903136.21689.114.camel@edumazet-glaptop2.roam.corp.google.com> <1422926330.21689.138.camel@edumazet-glaptop2.roam.corp.google.com> <1422973660.907.10.camel@edumazet-glaptop2.roam.corp.google.com> <1423051045.907.108.camel@edumazet-glaptop2.roam.corp.google.com> <1423053531.907.115.camel@edumazet-glaptop2.roam.corp.google.com> <1423055810.907.125.camel@edumazet-glaptop2.roam.corp.google.com> <1423056591.907.130.camel@edumazet-glaptop2.roam.corp.google.com> <1423084303.31870.15.camel@edumazet-glaptop2.roam.corp.google.com> <1423572896.28434.13.camel@edumazet-glaptop2.roam.corp.google.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Tue, 2015-02-10 at 04:54 -0800, Eric Dumazet wrote: > Hi Michal > > This is almost it ;) > > As I said you must do this using u64 arithmetics, we still support 32bit > kernels. > > Also, >> 20 instead of / 1000000 introduces a 5% error, I would use a > plain divide, as the compiler will use a reciprocal divide (ie : a > multiply) > > We use >> 10 instead of /1000 because a 2.4 % error is probably okay. > > ewma_add(&ar->tx_delay_us, > ktime_to_ns(ktime_sub(ktime_get(), > skb_cb->stamp)) / > NSEC_PER_USEC); btw I suspect this wont compile on 32 bit kernel You need to use do_div() as well : u64 val = ktime_to_ns(ktime_sub(ktime_get(), skb_cb->stamp)); do_div(val, NSEC_PER_USEC); ewma_add(&ar->tx_delay_us, val);