From: Felix Fietkau <nbd@nbd.name>
To: Johannes Berg <johannes@sipsolutions.net>,
Benjamin Beichler <Benjamin.Beichler@uni-rostock.de>
Cc: Karthik M <quic_karm@quicinc.com>,
linux-wireless@vger.kernel.org,
Tamizh Chelvam Raja <quic_tamizhr@quicinc.com>
Subject: Re: [PATCH v1] wifi: mac80211: Initialize EWMA fail avg to 1
Date: Fri, 21 Apr 2023 11:53:06 +0200 [thread overview]
Message-ID: <c22ecc12-6841-e20b-0ee8-eec2e6d6e3e6@nbd.name> (raw)
In-Reply-To: <ad5febda1c32c0d84aa8ac509fefc5b31a8b7ed4.camel@sipsolutions.net>
On 21.04.23 11:35, Johannes Berg wrote:
> To me, the first question is if there are potentially any users that are
> _relying_ on the current behaviour. This seems unlikely though, looking
> at the ~30 users, most sound like signal/rssi, packet sizes, etc.
>
> So let's say with the bug found here that prompted this patch, chances
> are that there aren't any users that really want 0 to be special. I also
> can't even really think of a reason for wanting that.
>
>
> So then let's say we want to fix the existing code. I can think of these
> possible ways:
>
> * splitting off a bit for initialized from the unsigned long
> (which at least for 64-bit should be OK since presumably most code
> using this will run on 32-bit systems too)
> * adding another value for it, e.g. making it u32 and adding a bool for
> "first value"
> * biasing the value, like Felix proposes, could be by 1 or -1 for
> example
>
> All of these have a memory cost, of course, though the first two are
> data and the second code, so for things like stations the code exists
> only once and the data multiple times. On 64-bit we can probably make
> the first two not have a data memory cost though.
>
> As for biasing the value, couldn't that lead to a similar problem? It's
> clearly less likely that the end of the range is reached rather than
> zero, but still?
I don't see how it can reduce the range in any way, since the bias is
added to the fractional part. A range reduction would seem to imply
having an average value that's bigger than the maximum allowed shifted
input (top bits cut off), and I don't think that's possible.
- Felix
next prev parent reply other threads:[~2023-04-21 9:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-17 10:02 [PATCH v1] wifi: mac80211: Initialize EWMA fail avg to 1 Karthik M
2023-04-18 13:04 ` Johannes Berg
2023-04-20 9:30 ` Benjamin Beichler
2023-04-20 10:27 ` Johannes Berg
2023-04-20 11:12 ` Benjamin Beichler
2023-04-20 12:22 ` Felix Fietkau
2023-04-20 13:00 ` Benjamin Beichler
2023-04-20 13:15 ` Felix Fietkau
2023-04-21 9:35 ` Johannes Berg
2023-04-21 9:53 ` Felix Fietkau [this message]
2023-04-21 10:34 ` Benjamin Beichler
2023-04-21 11:13 ` Johannes Berg
2023-04-21 11:51 ` Benjamin Beichler
2023-04-21 12:00 ` Felix Fietkau
2023-04-21 10:23 ` Benjamin Beichler
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=c22ecc12-6841-e20b-0ee8-eec2e6d6e3e6@nbd.name \
--to=nbd@nbd.name \
--cc=Benjamin.Beichler@uni-rostock.de \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_karm@quicinc.com \
--cc=quic_tamizhr@quicinc.com \
/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