From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795023637; b=kuBeUlFEY+ER7tYGZHl/KhVrktT8ruEf2GjOw0vOawM7pzH/e9HZct/urpddJMDliZhK llXPFFEwNsqLCxSqXOT+A7enT3wxGU2cQ36IU1JeG3HeWyqgR9Q6vTcVNL8a96Kslp4zg 3R+D+86XAMtcqVRCT1RXAnggtTrmsQHxjJX3uK9UXM7T7qPFl4VBAZpSAS2pHYc+43Rs6 RP2IX3dp/1AE80sNpXXQG0kLDniF+lVw2+eAyDwV2m/LPcyG1+C8q/0YIieIvUZRsfvpp 11AHweiy0K6GLJBDfqe4nNL70K5syIwqgj9/myFUj5aRo6Xd3QByrisquo77sOFcukg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795023637; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=5LoOK/RHvlsOOYn5j9H1VX5oK10ugQwMBvSQrI5gV5o=; b=4DtVapDqll3UnLEyP9sUmh8vsfgUwN5eZoDTiHD4jYJ4mkV4VWA9Saph1p6dDJt7VK6v 9m4/WxpivUPOv8tcqq7nt9aeX5PuheADSP3jDH5yVOpYSJ25wZOmGyTcQAjwKryQrKN+m LNeykS2FyftKArAf7pXb7fyHXE7BxqnHWXZyFafOdfJt7HK4hNAuzKauS948wia4RO6Di NKj4dnHNv8isZQR8GciArbfJIHKBZLfYsTCsQq5OhTVHPouhhvZ1ORRhCBIV+vOBPaL2b rm6ED9HT4t5FL9MRYqZ/2jFbdoXCd3Gm/kOdXMP7hpdFNga+GMKWxskRXc6YcV484Mw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=P6LRBCZC; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AA98606A325; Wed, 18 Nov 2026 17:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=P6LRBCZC Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F4521F000C4; Wed, 18 Nov 2026 17:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795023637; bh=5LoOK/RHvlsOOYn5j9H1VX5oK10ugQwMBvSQrI5gV5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=P6LRBCZC8BHNXWMU8u3FcMoUeve7NOtLxu/xIWDSKBgS6fk95Yl3FHYt/0M67dMhJ cHolBxc5ywm5KwivNp8vPds4eRGGEaB2pdX1rlsZ7bAXqLh98IxjG9SO3y35csVVmg D3nxfad79Zr+JI6mUhfJ9Vl/BzSyhX+HzPWOzXiM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Julius Bairaktaris , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Johannes Berg , Sasha Levin Subject: [PATCH 6.18 0441/2151] wifi: mac80211: dont reset the TXQ scheduling round number Date: Wed, 18 Nov 2026 15:36:16 +0100 Message-ID: <20261118150138.105202100@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150121.603863898@linuxfoundation.org> References: <20261118150121.603863898@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julius Bairaktaris [ Upstream commit 8ea81827d3537db7cfcc82c008f052bb1bbe7567 ] A round is ended when ieee80211_next_txq() meets a txq whose remembered round number is the current one, meaning it has gone full circle. When the AC exceeds the airtime limit, ieee80211_txq_schedule_start() sets the round number to 0 to close the round. The next open round is 1. A txq from an earlier round 1 still remembers the "1", so the next round stops on it and serves nothing. Fix: use a separate open/closed flag and let the round number keep counting. Testing: ~4200 skipped selections per 20s without the fix and 20 skipped selections per 20s with the fix on ath11k (with my AQL series applied) at BE 500/1000. Fixes: 8e4bac067105 ("wifi: mac80211: add a per-PHY AQL limit to improve fairness") Assisted-by: Claude:claude-opus-5 Signed-off-by: Julius Bairaktaris Reviewed-by: Toke Høiland-Jørgensen Link: https://patch.msgid.link/20260908144155.756569-1-julius@bairaktaris.de Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/ieee80211_i.h | 1 + net/mac80211/tx.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index a0b0eb4b2f2ae..0f35094b3898f 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1419,6 +1419,7 @@ struct ieee80211_local { spinlock_t active_txq_lock[IEEE80211_NUM_ACS]; struct list_head active_txqs[IEEE80211_NUM_ACS]; u16 schedule_round[IEEE80211_NUM_ACS]; + bool schedule_open[IEEE80211_NUM_ACS]; /* serializes ieee80211_handle_wake_tx_queue */ spinlock_t handle_wake_tx_queue_lock; diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 3224288583e20..67909f58c64a5 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -4169,7 +4169,7 @@ struct ieee80211_txq *ieee80211_next_txq(struct ieee80211_hw *hw, u8 ac) spin_lock_bh(&local->active_txq_lock[ac]); - if (!local->schedule_round[ac]) + if (!local->schedule_open[ac]) goto out; begin: @@ -4394,12 +4394,12 @@ void ieee80211_txq_schedule_start(struct ieee80211_hw *hw, u8 ac) spin_lock_bh(&local->active_txq_lock[ac]); - if (ieee80211_txq_schedule_airtime_check(local, ac)) { + local->schedule_open[ac] = + ieee80211_txq_schedule_airtime_check(local, ac); + if (local->schedule_open[ac]) { local->schedule_round[ac]++; if (!local->schedule_round[ac]) local->schedule_round[ac]++; - } else { - local->schedule_round[ac] = 0; } spin_unlock_bh(&local->active_txq_lock[ac]); -- 2.53.0