From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-21-ewr.dyndns.com (mxout-112-ewr.mailhop.org [216.146.33.112]) by lists.bufferbloat.net (Postfix) with ESMTP id 3F3972E0047 for ; Fri, 25 Feb 2011 10:27:49 -0800 (PST) Received: from scan-22-ewr.mailhop.org (scan-22-ewr.local [10.0.141.244]) by mail-21-ewr.dyndns.com (Postfix) with ESMTP id 8C0912BAF for ; Fri, 25 Feb 2011 18:27:31 +0000 (UTC) X-Spam-Score: -1.0 (-) X-Mail-Handler: MailHop by DynDNS X-Originating-IP: 209.85.214.43 Received: from mail-bw0-f43.google.com (mail-bw0-f43.google.com [209.85.214.43]) by mail-21-ewr.dyndns.com (Postfix) with ESMTP id E223F2036 for ; Fri, 25 Feb 2011 18:27:25 +0000 (UTC) Received: by bwz14 with SMTP id 14so2772536bwz.16 for ; Fri, 25 Feb 2011 10:27:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.46.154 with SMTP id j26mr2344439bkf.134.1298658444929; Fri, 25 Feb 2011 10:27:24 -0800 (PST) Sender: njs@vorpus.org Received: by 10.204.54.4 with HTTP; Fri, 25 Feb 2011 10:27:24 -0800 (PST) In-Reply-To: References: <1297907356-3214-1-git-send-email-linville@tuxdriver.com> <1298064074-8108-1-git-send-email-linville@tuxdriver.com> <20110221184716.GD9650@tuxdriver.com> <20110223222842.GA20039@tuxdriver.com> Date: Fri, 25 Feb 2011 10:27:24 -0800 X-Google-Sender-Auth: goZiKNophtZkdg3UfSLxjUmi-Ak Message-ID: Subject: Re: [RFC v2] mac80211: implement eBDP algorithm to fight bufferbloat From: Nathaniel Smith To: "John W. Linville" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: bloat-devel@lists.bufferbloat.net, johannes@sipsolutions.net, linux-wireless@vger.kernel.org X-BeenThere: bloat-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Developers working on AQM, device drivers, and networking stacks" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Feb 2011 18:27:49 -0000 On Fri, Feb 25, 2011 at 10:21 AM, Nathaniel Smith wrote: > static u64 _ktime_diff_to_now_and_unstash(ktime_t then, int * enqueued) { > > =C2=A0 =C2=A0 =C2=A0 =C2=A0timespec ts_then =3D ktime_to_timespec(then); > =C2=A0 =C2=A0 =C2=A0 =C2=A0timespec ts_now =3D ktime_to_timespec(ktime_ge= t()); > =C2=A0 =C2=A0 =C2=A0 =C2=A0*enqueued =3D ts_then.tv_sec >> LATENCY_BITS; > =C2=A0 =C2=A0 =C2=A0 =C2=A0ts_then.tv_sec &=3D (1 << LATENCY_BITS) - 1; > =C2=A0 =C2=A0 =C2=A0 =C2=A0ts_now.tv_sec &=3D (1 << LATENCY_BITS) - 1; > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ts_now.tv_sec < ts_then.tv_sec) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ts_now.tv_sec +=3D= (1 << LATENCY_BITS); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 timespec_sub(ts_now, ts_then); > } Err, plus the 'return timespec_to_ns(...)' on the last line, that I was trying to add when my computer suddenly decided I wanted to send the message. How embarrassing. Anyway, not sure this is a *good* idea, but it should work. Hopefully we don't actually need to measure latencies > 256 seconds in this context... -- Nathaniel