Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13176495pxu; Sun, 3 Jan 2021 05:05:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/sm1ppFD91d6xF6IPXGsIY8got8/KD0IfKe8pAsv61q8oPX/vgCW/T86RYC/ctaQgV6zV X-Received: by 2002:a17:906:c45a:: with SMTP id ck26mr63921717ejb.200.1609679142301; Sun, 03 Jan 2021 05:05:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609679142; cv=none; d=google.com; s=arc-20160816; b=TyMRsaSroSLMHTgbCyCSWnqeNDOAblC7SVkKbNvnRiVQ6FdbGbkgCrT0U+dX/Z2POa faGj6K1B7gB34TULAmx8+sl2kvV/RAgRfRaVw8i+Z8YvVmbArjSVZFXxeVBGxeb5x5zW 9wx5hSyxCItyrZTeMNAMCeUo9Cb5WAwCYOrueXCF38PYBCmcw/63ePrmYm3KInmoOk8S Pz9K42qVVnKepayW7qbwWHmF44KpEqArZJKsXVACG4NUgn1T9Cqd+Q8pmeEDetGgxh7c LGp6XOjwYnl3hzVJQhJZEOiwbho++i4KsRIRr07TRryOSQKfb9Yx83Qwqxnc/BjqSSzr 5DAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oXMsJeR3v95rSaNfDtJEu7h7Zxxxb6ljA5CBecDyCdI=; b=Fe0Fb8eQ0J4dQhTs94ELpHcYcClF2/JEkLLv5wqdThBZ1b2Qo8QdCDKeNoWhLykLja o5UcQueo5y9bTVheNIAfJ+cQdJsqj9MjflsiDOQ2z46o4e768Avn5WIt2mF9TFf8/TqQ H+S8XcUsqizieVXdEzFUV+vIvniJkNLwUJ2hEJ53tYzk++ZRjuLplFMRwH+Bd3Zsb12s qu9pUinGLFYXsSftxqWWh/p+VE1ePGNB61vMrZ/DJKYL4d6+XgM0r5fjdj1DnibR31Pi OJKqNgh6OVSi5qnL5o3UQ2yZaIKvHKupw+kbsE48760ZqsdC5PZPGIoUuVDMYzUCVzMW GE5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=CpuQqa3e; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si28448335ejb.246.2021.01.03.05.05.12; Sun, 03 Jan 2021 05:05:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=CpuQqa3e; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726129AbhACLw1 (ORCPT + 99 others); Sun, 3 Jan 2021 06:52:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbhACLw0 (ORCPT ); Sun, 3 Jan 2021 06:52:26 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDC2EC0613ED for ; Sun, 3 Jan 2021 03:51:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=oXMsJeR3v95rSaNfDtJEu7h7Zxxxb6ljA5CBecDyCdI=; b=CpuQqa3eKtWzqMOI98wTKAGSRW 5FHWXbIu7tNor+sPNwy2GfPCcaeOh8pPVU6cHxZ78coHFz4u9bsWX7Mg+dKGAaT4y11ElWQBZg4NK 7n0nixhHLYim/5RkF7mCQvGqHNpmd6XRCm7Fp5jlfuwAS+yrkUhMfBfLikK7wV1OiUb4=; Received: from p54ae91f2.dip0.t-ipconnect.de ([84.174.145.242] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1kw1vC-0000gv-MR; Sun, 03 Jan 2021 12:51:42 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH v2 4/8] mac80211: minstrel_ht: remove old ewma based rate average code Date: Sun, 3 Jan 2021 12:51:36 +0100 Message-Id: <20210103115140.18614-4-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210103115140.18614-1-nbd@nbd.name> References: <20210103115140.18614-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The new noise filter has been the default for a while now with no reported downside and significant improvement compared to the old code. Signed-off-by: Felix Fietkau --- net/mac80211/rc80211_minstrel_ht.c | 31 ++++++++---------------------- net/mac80211/rc80211_minstrel_ht.h | 1 - 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 1fc3e836fe95..9280461ed3cc 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -769,17 +769,8 @@ minstrel_ht_calc_rate_stats(struct minstrel_priv *mp, if (unlikely(mrs->attempts > 0)) { mrs->sample_skipped = 0; cur_prob = MINSTREL_FRAC(mrs->success, mrs->attempts); - if (mp->new_avg) { - minstrel_filter_avg_add(&mrs->prob_avg, - &mrs->prob_avg_1, cur_prob); - } else if (unlikely(!mrs->att_hist)) { - mrs->prob_avg = cur_prob; - } else { - /*update exponential weighted moving avarage */ - mrs->prob_avg = minstrel_ewma(mrs->prob_avg, - cur_prob, - EWMA_LEVEL); - } + minstrel_filter_avg_add(&mrs->prob_avg, + &mrs->prob_avg_1, cur_prob); mrs->att_hist += mrs->attempts; mrs->succ_hist += mrs->success; } else { @@ -913,10 +904,8 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, /* Try to increase robustness of max_prob_rate*/ minstrel_ht_prob_rate_reduce_streams(mi); - /* try to sample all available rates during each interval */ - mi->sample_count *= 8; - if (mp->new_avg) - mi->sample_count /= 2; + /* try to sample half of all available rates during each interval */ + mi->sample_count *= 4; if (sample) minstrel_ht_rate_sample_switch(mp, mi); @@ -1040,7 +1029,7 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband, struct ieee80211_tx_rate *ar = info->status.rates; struct minstrel_rate_stats *rate, *rate2, *rate_sample = NULL; struct minstrel_priv *mp = priv; - u32 update_interval = mp->update_interval / 2; + u32 update_interval = mp->update_interval; bool last, update = false; bool sample_status = false; int i; @@ -1090,9 +1079,8 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband, switch (mi->sample_mode) { case MINSTREL_SAMPLE_IDLE: - if (mp->new_avg && - (mp->hw->max_rates > 1 || - mi->total_packets_cur < SAMPLE_SWITCH_THR)) + if (mp->hw->max_rates > 1 || + mi->total_packets_cur < SAMPLE_SWITCH_THR) update_interval /= 2; break; @@ -1832,8 +1820,7 @@ minstrel_ht_alloc(struct ieee80211_hw *hw) mp->has_mrr = true; mp->hw = hw; - mp->update_interval = HZ / 10; - mp->new_avg = true; + mp->update_interval = HZ / 20; minstrel_ht_init_cck_rates(mp); for (i = 0; i < ARRAY_SIZE(mp->hw->wiphy->bands); i++) @@ -1853,8 +1840,6 @@ static void minstrel_ht_add_debugfs(struct ieee80211_hw *hw, void *priv, &mp->fixed_rate_idx); debugfs_create_u32("sample_switch", S_IRUGO | S_IWUSR, debugfsdir, &mp->sample_switch); - debugfs_create_bool("new_avg", S_IRUGO | S_IWUSR, debugfsdir, - &mp->new_avg); } #endif diff --git a/net/mac80211/rc80211_minstrel_ht.h b/net/mac80211/rc80211_minstrel_ht.h index 25c3664bddde..7d6d0b720f6d 100644 --- a/net/mac80211/rc80211_minstrel_ht.h +++ b/net/mac80211/rc80211_minstrel_ht.h @@ -60,7 +60,6 @@ struct minstrel_priv { struct ieee80211_hw *hw; bool has_mrr; - bool new_avg; u32 sample_switch; unsigned int cw_min; unsigned int cw_max; -- 2.28.0