Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2980432ybz; Mon, 27 Apr 2020 07:58:19 -0700 (PDT) X-Google-Smtp-Source: APiQypLG334OSHqOrcLeDEopD5DW0NxXUL+zGc6YTRTuDpQwNqtqc5XV/jqJqzJ/dWCHemvFDA4V X-Received: by 2002:aa7:dacc:: with SMTP id x12mr18822681eds.363.1587999498929; Mon, 27 Apr 2020 07:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587999498; cv=none; d=google.com; s=arc-20160816; b=ymIev+1K1/zwT4P+X0cVKMiDGiZiF9quOTHq1OqQnzg1qEL1Fk4JxietMBK7oagJoI MxQm+3JkrTbAuY1L1wJiuxs9Gi7sjxKTsWrYv7v68VJwJtu6iqjvLSN1/hXw0HI6n0wa QrdkRzwIALNjj36M2PeUcyCIhSc+6BM9SQWENy/SABNHFJdH+tfyjcc4pJAJfsElq508 Gy26QTcZ3xbVz17nTe0vQiNrR6r7rD4xizbEldIw2rH//yREuesCeAKj/k0BTmhcTeGn 3ALwQNeFRgEYqDCp3wlsAAH/MvOx2iRlqgT7lj0z9Q8js569FwNmk6nquLunCfrfSKex buzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=Sdkn6ZFvvY7mdww4wKjHFGr0Op8zs1XxdGFhVHct1rg=; b=MUU9WLhuj4/z6DdQBy0qeJhL19GyfzC71aWs/+dARi7a+NFYmFtwL1WXFO+qKpXMoG UWGYzofjO79jvag4YbCJOM18SPvrInD8hOga7SM8WQbJKD2lcF+mJf/pf3Kky3W+nIHx HhkfR5iCeIHla1F2guQrS6EYzVBbE7C5nxu8M6Z2tOqKhWFkcu6emg65jnLWl/SBHC44 2SEBWb+R20e9PxbFXcByW6pVIQrOORBbx50PzDGYZ5dmGgbkC5Xh3YQWkFWh5u07fZkP mCYZLoDmWMUkwLSjSjrm1MnqmN+5xYQTPL/5eLkYFEdFpmoHr7Rj75jL38ewxBVVpGdv EgqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=eI6yfMDO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si9412044ejd.83.2020.04.27.07.57.44; Mon, 27 Apr 2020 07:58:18 -0700 (PDT) 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=pass header.i=@candelatech.com header.s=default header.b=eI6yfMDO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727817AbgD0Oyj (ORCPT + 99 others); Mon, 27 Apr 2020 10:54:39 -0400 Received: from mail2.candelatech.com ([208.74.158.173]:38002 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727010AbgD0Oyj (ORCPT ); Mon, 27 Apr 2020 10:54:39 -0400 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 8D0A313C2B0; Mon, 27 Apr 2020 07:54:38 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 8D0A313C2B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1587999278; bh=0tGzDKRIO3qnsG4Sb0tCEgkRcqfUN2aVPcI9wmhzKK8=; h=From:To:Cc:Subject:Date:From; b=eI6yfMDOppSEgOrND6TrlVEAXRfR7xQrexOjowgXInRBosBj5kV8vTxqvcEMmh2zu GS8/+Teg+RBRYQ8726OpT02WQyD+DIj2fbm5gWonZWP1bHq9Vv7PNbSQtmaURLxfVp y1+jhGYeKSfpOvbXrtJE6XsH3q/uy7Y12o9hSdgA= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: Ben Greear Subject: [PATCH] ath10k: Restart xmit queues below low-water mark. Date: Mon, 27 Apr 2020 07:54:35 -0700 Message-Id: <20200427145435.13151-1-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear While running tcp upload + download tests with ~200 concurrent TCP streams, 1-2 processes, and 30 station vdevs, I noticed that the __ieee80211_stop_queue was taking around 20% of the CPU according to perf-top, which other locking taking an additional ~15%. I believe the issue is that the ath10k driver would unlock the txqueue when a single frame could be transmitted, instead of waiting for a low water mark. So, this patch adds a low-water mark that is 1/4 of the total tx buffers allowed. This appears to resolve the performance problem that I saw. Tested with recent wave-1 ath10k-ct firmware. Signed-off-by: Ben Greear --- drivers/net/wireless/ath/ath10k/htt.h | 1 + drivers/net/wireless/ath/ath10k/htt_tx.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h index 31c4ddbf45cb..b5634781c0dc 100644 --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h @@ -1941,6 +1941,7 @@ struct ath10k_htt { u8 target_version_major; u8 target_version_minor; + bool needs_unlock; struct completion target_version_received; u8 max_num_amsdu; u8 max_num_ampdu; diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index 9b3c3b080e92..44795d9a7c0c 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -145,8 +145,10 @@ void ath10k_htt_tx_dec_pending(struct ath10k_htt *htt) lockdep_assert_held(&htt->tx_lock); htt->num_pending_tx--; - if (htt->num_pending_tx == htt->max_num_pending_tx - 1) + if ((htt->num_pending_tx <= (htt->max_num_pending_tx / 4)) && htt->needs_unlock) { + htt->needs_unlock = false; ath10k_mac_tx_unlock(htt->ar, ATH10K_TX_PAUSE_Q_FULL); + } } int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt) @@ -157,8 +159,10 @@ int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt) return -EBUSY; htt->num_pending_tx++; - if (htt->num_pending_tx == htt->max_num_pending_tx) + if (htt->num_pending_tx == htt->max_num_pending_tx) { + htt->needs_unlock = true; ath10k_mac_tx_lock(htt->ar, ATH10K_TX_PAUSE_Q_FULL); + } return 0; } -- 2.20.1