Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp313125pxb; Fri, 15 Jan 2021 04:05:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPZXuMxuFSysYn8afowPMvJr/s1Xj7WWS+gNRfZx6vXBakmFNwAXKNMKI6F/gFeA/KnWeF X-Received: by 2002:aa7:dd05:: with SMTP id i5mr9306690edv.223.1610712339340; Fri, 15 Jan 2021 04:05:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610712339; cv=none; d=google.com; s=arc-20160816; b=moYc+b4GNOZKN6/AvJj22VFKGoLQkWyOGBqR8h61o+FyiZv9XIkeXKn3gkRTjsOuYo dVVPGUk+25XTfHqum8mrLWapJozn2y0MVFEMOQ2az8dAeQI7ZnJ0DhXDlhx+IgHSx+Qc YcwWvEk8z2VZAqy8IithgKfB7XtRTpgY4c4GRJE9ZOBilxtXMEOyzvFh+AqNZPOeuLvi 4yI05iaDqmapPJYZkc2abcMFuzHI0LtliD9TbFmcufOeT8akJIJVdped1oNf/oqldW4Q Ratbknn0aSqLSNRSl+PLQmn0vvSR051QfR6EQHtbZWNDm0wCmxT/xVf1gkT1cI1EtWBX hlow== 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=YNRLt2UUkf78VmTaffAe+483QNWKQahBjp3Xcuf2pewK8kC0RPC23gDWJtSU2sPgKB 3jo9l3CI03E3Nti+4oKXH/1db6ozahbOCn2dYjLWQsyFl88Hb6XLHEdY091JkolB6dCP dWBimgYyKgxYUJYm1AJx2SOojT+OCw6C4boNcB/7qBPkhkYMTnOZdHxd5DMgDOP9ndvz q7xeu+gC3MO3WTrY2dHpe7vloKyY58S74R1oQ92YsVGvZeWzY3rWAxyKmefHER22fPYW WFU6BgT4wd0V5UmNcrxjZEq5axNSMOIejZL3lJZOg9mc9TL6Z5fM+ZD+YGpXE9lN9TU+ V3/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=A5BNAfH4; 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 q5si3565021ejj.266.2021.01.15.04.05.15; Fri, 15 Jan 2021 04:05:39 -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=A5BNAfH4; 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 S1730597AbhAOMDw (ORCPT + 99 others); Fri, 15 Jan 2021 07:03:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728953AbhAOMDw (ORCPT ); Fri, 15 Jan 2021 07:03:52 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA0C9C06179A for ; Fri, 15 Jan 2021 04:02:48 -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=A5BNAfH4oBi+UVrZnc0i6TdTPF X1xMXBOKaAmKOz+f3iYE43SyXvbFzzC+0WMD79dwtdHgYo7/rCzgyTTZpmKGhESeoQLkYwkKEDuG1 hxcDPMR+hIhYUFCK0GlSx+6WARjVibyWLSVa6JHQKoTXAn1bVNosmk/vyESmS0EBYvN8=; 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 1l0NoU-0006Y0-96; Fri, 15 Jan 2021 13:02:46 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH v3 4/9] mac80211: minstrel_ht: remove old ewma based rate average code Date: Fri, 15 Jan 2021 13:02:37 +0100 Message-Id: <20210115120242.89616-5-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210115120242.89616-1-nbd@nbd.name> References: <20210115120242.89616-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