Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4518300ybz; Tue, 28 Apr 2020 12:47:04 -0700 (PDT) X-Google-Smtp-Source: APiQypIFexi8ETHR/04LkgrYKBn0J/CKxAdVkjPHwwDZv9NaQlL0/v4MoyK1nwga8E3k3u5upNOE X-Received: by 2002:a17:906:4ed6:: with SMTP id i22mr2028035ejv.146.1588103224538; Tue, 28 Apr 2020 12:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588103224; cv=none; d=google.com; s=arc-20160816; b=tiXt0q637+HQCww6K6PcMKtly0t2RWFSXIE7oGx+XYHETvS2EwGqi50C4hD3NgOpNX D3R7e44ta9kAA5m3akDX0/WsGgIZ+CHBTtRMxZ29mdhWk4C2D1Tz3VBbf8SMR80MiQML 1yVv9bQ73d+N8ySffTVVJO5eMcUYEvqtsNaTX0H2GB2bZPbFIMh5fcZp7/+nox8EBE7J 6UjNTQESM1zt/cD7/ESHv81EjAzWgUYas35flxZMHCTZhsWjGQf2VrPLx/tYR1k1VJJB qdFe4VgksgM71L7g7touxf13PLlc+VNxsKMg+721pphqR7Z9j+wCycRvR1lQ4BM8ZrF+ kyOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:from; bh=5wfkVCYvmMEB/jNmrJcgoQLeH8gTeso/syaCHdJzxOc=; b=qoOBcFKq/0Jc/edTlVOZr9Wph3hSb3xF3DefbihOQN5HVOVBlC37WVGlfkJNDuVnR9 siLfkF8HOvtfpQAX124GN8BD9rPLWVBxsVqtvz8sl7wkaWEVbFqIvJqRpOwktPq1bm2Q zWN4r4z/DZap+1/17HN5qdVxg8qahAq6p6fdixp33gM34+3nSeeZjo1QxelDYRbaQxso B2Jbo6Gco/2LVthA1/6/kzqc4bAGVXPckTW0qrhW5wivIS/h5kFeSrj53wxtiS9nOc3b +7OIcMdEWfNUTul3YNrj8aUyLPx83qGlN6NJmEeSFF2WqA8OP+bo5HDBNX+2MpsVMvsu E35w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toke.dk header.s=20161023 header.b=WTQDD3pT; 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=REJECT sp=REJECT dis=NONE) header.from=toke.dk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si2532658ejx.85.2020.04.28.12.46.41; Tue, 28 Apr 2020 12:47:04 -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=@toke.dk header.s=20161023 header.b=WTQDD3pT; 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=REJECT sp=REJECT dis=NONE) header.from=toke.dk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728952AbgD1ToP (ORCPT + 99 others); Tue, 28 Apr 2020 15:44:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728944AbgD1ToP (ORCPT ); Tue, 28 Apr 2020 15:44:15 -0400 Received: from mail.toke.dk (mail.toke.dk [IPv6:2a0c:4d80:42:2001::664]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D66F9C03C1AB for ; Tue, 28 Apr 2020 12:44:14 -0700 (PDT) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=toke.dk; s=20161023; t=1588102660; bh=bO+E46na0DxONeKZaofpgSO9a9Fvo1tqjPNZ9wwni9g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WTQDD3pTDy1GB2QsKbkxbwQKMf1SGcvXQdZQ84xorW8V3bBpUjAZCGVn+3A7Ps8u2 nuPrsH7B4YOAA7ENz8kDm9QXZbDFP4Y64CgqVBr63fhlb6uIsRDFKFLCJDvD5i2Iz5 EvvFBcxRnQNyxFbBiNM13AUa4fIoAuEnXi/xrIZ3DWXJ0AnVYytmyCfff4qt3eQLaD s1V7HlBIfWMVCV2QRMAczZKB7KWmZPOOx8NjKP+hvnyh+WdOX0oxhoW48CrjPSHZno EUSx++AyA1zPhjcKdKB08AKJvLfRpj5yIpEPylv0HM5f8H+igVk9NkuMmxh1HJb2QP KU9V6p5xoYBbQ== To: greearb@candelatech.com, linux-wireless@vger.kernel.org Cc: Ben Greear Subject: Re: [PATCH] ath10k: Restart xmit queues below low-water mark. In-Reply-To: <20200427145435.13151-1-greearb@candelatech.com> References: <20200427145435.13151-1-greearb@candelatech.com> Date: Tue, 28 Apr 2020 21:37:40 +0200 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87h7x3v1tn.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org greearb@candelatech.com writes: > 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) { Why /4? Seems a bit arbitrary? What's a typical value of max_num_pending_tx? -Toke