From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-bw0-f46.google.com ([209.85.214.46]:64371 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932620Ab1BYS10 convert rfc822-to-8bit (ORCPT ); Fri, 25 Feb 2011 13:27:26 -0500 Received: by bwz15 with SMTP id 15so2189507bwz.19 for ; Fri, 25 Feb 2011 10:27:25 -0800 (PST) MIME-Version: 1.0 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 Message-ID: Subject: Re: [RFC v2] mac80211: implement eBDP algorithm to fight bufferbloat From: Nathaniel Smith To: "John W. Linville" Cc: linux-wireless@vger.kernel.org, bloat-devel@lists.bufferbloat.net, johannes@sipsolutions.net, nbd@openwrt.org Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: 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) { > >        timespec ts_then = ktime_to_timespec(then); >        timespec ts_now = ktime_to_timespec(ktime_get()); >        *enqueued = ts_then.tv_sec >> LATENCY_BITS; >        ts_then.tv_sec &= (1 << LATENCY_BITS) - 1; >        ts_now.tv_sec &= (1 << LATENCY_BITS) - 1; >        if (ts_now.tv_sec < ts_then.tv_sec) >                ts_now.tv_sec += (1 << LATENCY_BITS); >         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