From: Larry Finger <larry.finger@lwfinger.net>
To: Jiri Benc <jbenc@suse.cz>
Cc: "Cahill, Ben M" <ben.m.cahill@intel.com>,
benmcahill@gmail.com, flamingice@sourmilk.net,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/1] mac80211: Replace overly "sticky" averaging filters for rssi, signal, noise.
Date: Fri, 13 Jul 2007 12:54:29 -0500 [thread overview]
Message-ID: <4697BC55.1080704@lwfinger.net> (raw)
In-Reply-To: <20070713172338.71bc4216@griffin.suse.cz>
Jiri Benc wrote:
> On Tue, 10 Jul 2007 21:59:13 -0700, Cahill, Ben M wrote:
>> Postponing the division keeps the running average using more significant
>> bits, so each new sample has a meaningful, surviving impact to the
>> running average. Sorry, "high-precision" is the best term that I can
>> think of to describe more bits being used in the running average. The
>> "binary point" is between bits 3 and 4; think of bits 3:0 as
>> "remainder".
>
> Thanks, that makes sense. Please include something like this
> explanation in the description of the patch when you resend it.
>
>> There is a subtle difference between:
>>
>> 1) last_rssi * 15 / 16
>>
>> 2) last_rssi - (last_rssi / 16)
>>
>> The first one would get stuck at -801 if there were a series of -51s
>> coming in.
>> -801 * 15 / 16 would get quantized to -750 each time, so the output
>> would be stuck at -801 (-50 dBm).
>>
>> The second one favors the high precision memory, and would progress from
>> -801 to -802, etc., as a series of -51s came in:
>> -801 - (-801/16) = -751
>
> So it's basically just a different rounding - in the current code, it's
> like float division with the result rounded down, while your change
> makes it to round up (speaking about absolute value). Nothing about
> precision here :-)
>
>> I saw 2 instances of sta->last_rssi being used in ieee80211_ioctl.c, and
>> STA_FILE(last_rssi, last_rssi, D) in debugfs_sta.c, which I didn't
>> understand (still don't) and was afraid to touch, so I thought the
>> safest thing with least impact would be to add the 3 additional
>> variables, and do the division in one place for each of the 3
>> rssi/signal/noise.
>>
>> If we do the division when passing to user space, how should STA_FILE be
>> handled, if necessary?
>
> Johannes was quicker than me (thanks) :-)
>
>> Thanks for your comments. I'll wait for your answer, and try again.
>
> Thanks and sorry for the delayed answer,
I added the wireless statistics to d80211 (it was that long ago) and I used 16-point averaging based
on my experiences with an early version of the bcm43xx-softmac driver where the rssi value was quite
jittery. From a quick test on the current drivers, the assumptions seem not to be valid and it is
quite possible that averaging may not be needed, or that one can get by with a 2- or 4-point process.
My suggestion would be to circulate a trial patch with averaging removed and ask for testing to see
if it makes the results too jumpy. I can prepare that patch if you wish.
Larry
next prev parent reply other threads:[~2007-07-13 17:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-10 23:05 [PATCH 1/1] mac80211: Replace overly "sticky" averaging filters for rssi, signal, noise benmcahill
2007-07-11 0:25 ` Jiri Benc
2007-07-11 4:59 ` Cahill, Ben M
2007-07-12 22:03 ` Johannes Berg
2007-07-13 15:23 ` Jiri Benc
2007-07-13 17:54 ` Larry Finger [this message]
2007-07-13 18:19 ` Cahill, Ben M
2007-07-13 18:52 ` [RFC/T] mac80211: Remove " Larry Finger
2007-07-25 18:52 ` Cahill, Ben M
2007-07-12 21:15 ` [PATCH 1/1] mac80211: Replace " Johannes Berg
2007-07-25 18:50 ` [PATCH 1/1] mac80211: Replace overly "sticky" averagingfilters " Cahill, Ben M
2007-07-26 15:17 ` Johannes Berg
2007-07-26 16:41 ` [PATCH 1/1] mac80211: Replace overly "sticky" averagingfiltersfor " Cahill, Ben M
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=4697BC55.1080704@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=ben.m.cahill@intel.com \
--cc=benmcahill@gmail.com \
--cc=flamingice@sourmilk.net \
--cc=jbenc@suse.cz \
--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).