linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
	johannes@sipsolutions.net
Subject: Re: [PATCH v3 5/7] mac80211: add lowest rate into minstrel's randmon rate sampling table
Date: Mon, 04 Mar 2013 20:02:32 +0100	[thread overview]
Message-ID: <5134EFC8.20207@openwrt.org> (raw)
In-Reply-To: <1362422905-78079-6-git-send-email-thomas@net.t-labs.tu-berlin.de>

On 2013-03-04 7:48 PM, Thomas Huehn wrote:
> While minstrel bootstraps and fills the success probabilities of each
> rate the lowest rate has typically a very high success probability
> (often 100% in our tests).
> Its statistics are never updated but considered to setup the mrr chain.
> In our tests we see that especially the 3rd mrr stage (which is that
> rate providing highest success probability) is filled with the lowest rate
> because its initial high sucess probability is never updated. By design
> the 4th mrr stage is filled with the lowest rate so often 3rd and 4th
> mrr stage are equal.
> 
> This patch follows minstrels general approach of assuming as little
> as possible about rate dependencies. Consequently we include the
> lowest rate into the random sampling table to get balanced up-to-date
> statistics of all rates and therefore balanced decisions.
> 
> Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
> ---
>  net/mac80211/rc80211_minstrel.c    | 20 +++++++-------------
>  net/mac80211/rc80211_minstrel.h    |  4 +++-
>  net/mac80211/rc80211_minstrel_ht.c |  1 -
>  3 files changed, 10 insertions(+), 15 deletions(-)
> 
> diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
> index aa59f29..aa1e81a 100644
> --- a/net/mac80211/rc80211_minstrel.c
> +++ b/net/mac80211/rc80211_minstrel.c
> @@ -370,26 +369,21 @@ static void
>  init_sample_table(struct minstrel_sta_info *mi)
>  {
>  	unsigned int i, col, new_idx;
> -	unsigned int n_srates = mi->n_rates - 1;
>  	u8 rnd[8];
>  
>  	mi->sample_column = 0;
>  	mi->sample_row = 0;
> -	memset(mi->sample_table, 0, SAMPLE_COLUMNS * mi->n_rates);
> +	memset(mi->sample_table, 0xff, SAMPLE_COLUMNS * mi->n_rates);
>  
>  	for (col = 0; col < SAMPLE_COLUMNS; col++) {
> -		for (i = 0; i < n_srates; i++) {
> +		for (i = 0; i < mi->n_rates; i++) {
>  			get_random_bytes(rnd, sizeof(rnd));
> -			new_idx = (i + rnd[i & 7]) % n_srates;
> +			new_idx = (i + rnd[i]) % mi->n_rates;
Don't remove the '& 7' part, otherwise the rnd array will overflow.
There's no need for it to be as big as the number of rates though.
Also, there's a typo in the subject line: 'randmon'.

- Felix

  reply	other threads:[~2013-03-04 19:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 18:48 [PATCH v3 0/7] mac80211: improve and consolidate minstrel rate control Thomas Huehn
2013-03-04 18:48 ` [PATCH v3 1/7] mac80211: merge EWMA calculation of minstrel_ht and minstrel Thomas Huehn
2013-03-04 18:48 ` [PATCH v3 2/7] mac80211: merge value scaling macros " Thomas Huehn
2013-03-04 18:48 ` [PATCH v3 3/7] mac80211: add documentation and verbose variable names in Thomas Huehn
2013-03-04 18:48 ` [PATCH v3 4/7] mac80211: extend minstrel's rate sampling to avoid unsampled rates Thomas Huehn
2013-03-04 18:48 ` [PATCH v3 5/7] mac80211: add lowest rate into minstrel's randmon rate sampling table Thomas Huehn
2013-03-04 19:02   ` Felix Fietkau [this message]
2013-03-04 18:48 ` [PATCH v3 6/7] mac80211: treat minstrel success probabilities below 10% as implausible Thomas Huehn
2013-03-04 18:48 ` [PATCH v3 7/7] mac80211: improve minstrels rate sorting by means of throughput & probability Thomas Huehn

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=5134EFC8.20207@openwrt.org \
    --to=nbd@openwrt.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=thomas@net.t-labs.tu-berlin.de \
    /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).