From: Mattias Nissler <mattias.nissler@gmx.de>
To: Stefano Brivio <stefano.brivio@polimi.it>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
"John W. Linville" <linville@tuxdriver.com>,
Johannes Berg <johannes@sipsolutions.net>
Subject: Re: [RFC/T][PATCH 1/3] rc80211-pid: introduce rate behaviour learning algorithm
Date: Mon, 10 Dec 2007 21:48:34 +0100 [thread overview]
Message-ID: <1197319714.7493.0.camel@localhost> (raw)
In-Reply-To: <20071210090323.47d657e6@morte>
On Mon, 2007-12-10 at 09:03 +0100, Stefano Brivio wrote:
> On Mon, 10 Dec 2007 07:48:56 +0100
> Mattias Nissler <mattias.nissler@gmx.de> wrote:
>
> > > > > +/* Normalize the failed frames per-rate differences. */
> > > > > +static void rate_control_pid_normalize(struct rc_pid_rateinfo *r, int l)
> > > > > +{
> > > > > + int i;
> > > > > +
> > > > > + if (r[0].diff > RC_PID_NORM_FACTOR)
> > > > > + r[0].diff -= RC_PID_NORM_FACTOR;
> > > > > + else if (r[0].diff < -RC_PID_NORM_FACTOR)
> > > > > + r[0].diff += RC_PID_NORM_FACTOR;
> > > > > + for (i = 0; i < l - 1; i++)
> > > > > + if (likely(r[i + 1].valid)) {
> > > > > + if (r[i + 1].diff > r[i].diff + RC_PID_NORM_FACTOR)
> > > > > + r[i + 1].diff -= RC_PID_NORM_FACTOR;
> > > > > + else if (r[i + 1].diff <= r[i].diff)
> > > > > + r[i + 1].diff += RC_PID_NORM_FACTOR;
> > > > > + }
> > > >
> > > > If I understand correctly, you apply an offset to all valid entries. So
> > > > I'd rather call it RC_PID_NORM_OFFSET.
> > >
> > > Well, I don't care that much. I was referring to this definition of factor:
> > >
> > > n., 1. One that actively contributes to an accomplishment, result, or process
> > >
> > > Anyway "offset" may be more clear. Will fix it.
> > >
> > > > Furthermore, what if the diff
> > > > values are larger than k * RC_PID_NORM_OFFSET (with k an integer)? If
> > > > you first compute the offset, you can just loop over the array and apply
> > > > the offset without checking for the condition.
> > >
> > > I frankly don't get your point here. No offsets are computed...
> >
> > Well, let's see, maybe I misunderstood the code. I thought the idea was:
> > If the diff values grow too large (too small), we substract (add)
> > RC_PID_NORM_FACTOR from (to) all of them. But now it seems to me you do
> > this for every diff value individually to achieve something like an
> > aging effect. Is that correct? The term "normalize" probably confused
> > me.
>
> I used the "normalize" term as in "process that makes something more
> normal, which typically means conforming to some regularity or rule, or
> returning from some state of abnormality" [wikipedia].
>
> What I do here is to assume that lower rates will perform better, in the
> long term, let's make an example: my card can transmit at three rates, 1,
> 2, and 3M. But it performs really bad at 3M, so what I can expect to have
> is:
>
> [rate] [diff]
> 1 0
> 2 10
> 3 105
> [this means we have used rate 1, then switched to rate 2 and had 10% more
> fails, then switched to rate 3 and had 95% more fails than rate 2]
>
> But now we don't know if bad performance of rate 3 was due to external
> conditions or to a somehow broken device. Let's say that we move our
> laptop to a different environment, which causes the rate 3 to work
> reasonably well. That 105 doesn't make sense now and we have to make it
> similar to diff for rate 2. But not equal, as 1) it's unlikely to be equal;
> 2) if it would be equal we would never use rate 2, which we can
> theoretically suppose to be a little better than rate 3 (compare with
> _shift_adjust() here). So in the end, if we don't get any recent events,
> we should end up with something like:
>
> [rate] [diff]
> 1 0
> 2 3
> 3 6
> [with norm_offset set to 3]
>
> So what really matters here are recent events. Yes, it's something like an
> aging effect. Note that norm_offset is meant to tune how fast it's supposed
> that we move between different environments. A little caveat here: all
> values can be negative, even the one for rate 1. This doesn't matter,
> because anyway, as per the definition of the algorithm, all values are
> referred to the lowest rate behaviour (and not to zero).
Ok, understood now :-)
Mattias
next prev parent reply other threads:[~2007-12-10 20:48 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-09 20:15 [RFC/T][PATCH 0/3] rc80211-pid: PID controller enhancements Stefano Brivio
2007-12-09 20:19 ` [RFC/T][PATCH 1/3] rc80211-pid: introduce rate behaviour learning algorithm Stefano Brivio
2007-12-09 22:25 ` Mattias Nissler
2007-12-09 23:21 ` Stefano Brivio
2007-12-10 0:17 ` Stefano Brivio
2007-12-10 2:24 ` [RFC/T][PATCH v2 " Stefano Brivio
2007-12-10 6:51 ` Mattias Nissler
2007-12-10 7:23 ` Stefano Brivio
2007-12-11 23:29 ` [RFC/T][PATCH v3 " Stefano Brivio
2007-12-12 0:25 ` [RFC/T][PATCH v4 " Stefano Brivio
2007-12-10 6:48 ` [RFC/T][PATCH " Mattias Nissler
2007-12-10 8:03 ` Stefano Brivio
2007-12-10 20:48 ` Mattias Nissler [this message]
2007-12-10 20:56 ` Mattias Nissler
2007-12-10 21:30 ` Stefano Brivio
2007-12-10 22:05 ` Mattias Nissler
2007-12-10 8:08 ` Stefano Brivio
2007-12-10 20:51 ` Mattias Nissler
2007-12-10 21:22 ` Stefano Brivio
2007-12-10 21:31 ` st3
2007-12-10 22:09 ` Mattias Nissler
2007-12-11 14:52 ` Johannes Berg
2007-12-11 17:23 ` Mattias Nissler
2007-12-12 17:13 ` Johannes Berg
2007-12-12 20:06 ` Mattias Nissler
2007-12-12 21:34 ` Stefano Brivio
2007-12-13 11:42 ` Johannes Berg
2007-12-14 5:27 ` Jouni Malinen
2007-12-14 12:09 ` Johannes Berg
2007-12-13 8:00 ` Holger Schurig
2007-12-11 14:51 ` Johannes Berg
2007-12-09 20:21 ` [RFC/T][PATCH 2/3] rc80211-pid: introduce PID sharpening factor Stefano Brivio
2007-12-09 22:29 ` Mattias Nissler
2007-12-09 23:31 ` Stefano Brivio
2007-12-09 23:53 ` Mattias Nissler
2007-12-10 2:28 ` [RFC/T][PATCH v2 " Stefano Brivio
2007-12-10 6:28 ` Mattias Nissler
2007-12-10 7:21 ` Stefano Brivio
2007-12-10 7:44 ` Mattias Nissler
2007-12-10 8:17 ` Stefano Brivio
2007-12-11 23:31 ` [RFC/T][PATCH v3 " Stefano Brivio
2007-12-09 20:28 ` [RFC/T][PATCH 3/3] rc80211-pid: allow for parameters to be set through sysfs Stefano Brivio
2007-12-09 22:30 ` Mattias Nissler
2007-12-10 2:31 ` [RFC/T][PATCH v2 " Stefano Brivio
2007-12-16 9:40 ` [RFC/T][PATCH " Stefano Brivio
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=1197319714.7493.0.camel@localhost \
--to=mattias.nissler@gmx.de \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=stefano.brivio@polimi.it \
/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).