linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] mac80211: minstrel_ht: replace rate stats ewma with a better moving average
Date: Tue, 1 Oct 2019 12:52:13 +0200	[thread overview]
Message-ID: <017c1a59-edf2-0a1a-aa8c-3c32e57d6cd0@nbd.name> (raw)
In-Reply-To: <f40bd542d0d13f5be701de41b8870b0bd1f34230.camel@sipsolutions.net>

On 2019-10-01 12:17, Johannes Berg wrote:
> 
>> This change replaces the EWMA implementation with a moving average that's
>> designed to significantly reduce lag while keeping a bigger window size
>> by being better at filtering out noise.
>> 
>> It is only slightly more expensive than the simple EWMA and still avoids
>> divisions in its calculation.
>> 
>> The algorithm is adapted from an implementation intended for a completely
>> different field (stock market trading), where the tradeoff of lag vs
>> noise filtering is equally important. It is based on the "smoothing filter"
>> from http://www.stockspotter.com/files/PredictiveIndicators.pdf.
>> 
>> I have adapted it to fixed-point math with some constants so that it uses
>> only addition, bit shifts and multiplication
>> 
> 
> Would it be worth pulling that out into similar helpers to EWMA in
> average.h, perhaps even in the same file?
> 
> You need to keep a bit more state, but essentially the same API should
> work since EWMA already declares the "struct ewma_something" once you
> use the DECLARE_EWMA().
Might be useful, yes. The main issue here is that the period / window
size has to be hardcoded through the coefficient values, unless we find
a way to do floating point math, including exp() and cos() at compile
time, including conversion to fixed point.

- Felix

  reply	other threads:[~2019-10-01 10:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-29 15:46 [PATCH 1/2] mac80211: minstrel: remove divisions in tx status path Felix Fietkau
2019-09-29 15:46 ` [PATCH 2/2] mac80211: minstrel_ht: replace rate stats ewma with a better moving average Felix Fietkau
2019-09-29 18:42   ` Toke Høiland-Jørgensen
2019-09-29 19:18     ` Felix Fietkau
2019-09-29 19:46       ` Toke Høiland-Jørgensen
2019-10-01 10:17   ` Johannes Berg
2019-10-01 10:52     ` Felix Fietkau [this message]
2019-10-01 11:06       ` Johannes Berg
2019-10-01 11:11         ` Johannes Berg
2019-10-08  9:18   ` Koen Vandeputte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=017c1a59-edf2-0a1a-aa8c-3c32e57d6cd0@nbd.name \
    --to=nbd@nbd.name \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).