Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4516222ybz; Tue, 28 Apr 2020 12:44:13 -0700 (PDT) X-Google-Smtp-Source: APiQypKwtoTRmNVRF/l6mx3yGK4yfXhA2GoH3RcY0gFfKo8wz9XlRoSJclpOb6dVr5UyxcSjS0m1 X-Received: by 2002:a05:6402:1766:: with SMTP id da6mr23395399edb.119.1588103053460; Tue, 28 Apr 2020 12:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588103053; cv=none; d=google.com; s=arc-20160816; b=RAF0LcmtG8TXJLlurEoqoKlQ2Dnnxc8wHcoRq7Bj2yi86S+lgVasNsow0+YRcDS7N9 ORLE0K3QCtnIRBbDXel8Ay1Z2KniwsiKRUe3sr2lYJ7zxaPxKXUSxbatbgDS49QAAaSh u4WPoZBimH8xQw8o6EO5Fg+5yWDgIjt3fkxji8wZ2ppkfvqYjUFtyuTtRefbuIAW9jnO I31KlL95M/ky5E6cvDvKzyP+ty03IXhg1dzzpNePm26TffIiQgoexHMG7GAneVe3bUgX +3hjGNAAGSD8m9tFH448GNVSN8A30aFLs8ZDOV1vIcu/kdkk2z2UgKrKALraSl6hoVHh aQAA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8dNzZoo6BwE+y+2RELR9+ATC7jomEHgy2WoRWlyh2FU=; b=AnhhC34x9OTn+eAkzGqZySlatEREZSxr8K9PNMRdotzFnnPtGBUPoaURkmp7/KV75B 8QqdxbN8y5oUiffFy8xtrM/V0hatsGjsG+DzZjAzx4Lj6XuqIX0f9U3wV+C+iLawBA9J 7Qw/O4plMnDIG6AYkw13Dht8rnFrALsMdsRnV5ptetApdtW36YE3u2GwGZo2mBf2P4se EIp6DHDgABEtKFeh4u16zr4l18paCiIsJG7rYa0BgKVBPDUmWmLmtIW20A9/gihkEyqj pbBv98SqTmoIOgp5H4biFLXJAdg8QnTJcBQrFu3pIHax3w9gH80QB5NHe3CU6Z0bbMu5 GYFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CNnd4biD; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c8si2121292edn.240.2020.04.28.12.43.32; Tue, 28 Apr 2020 12:44:13 -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=@gmail.com header.s=20161025 header.b=CNnd4biD; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728559AbgD1TkD (ORCPT + 99 others); Tue, 28 Apr 2020 15:40:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728392AbgD1TkC (ORCPT ); Tue, 28 Apr 2020 15:40:02 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 913B5C03C1AB for ; Tue, 28 Apr 2020 12:40:02 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id i16so12175ils.12 for ; Tue, 28 Apr 2020 12:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=8dNzZoo6BwE+y+2RELR9+ATC7jomEHgy2WoRWlyh2FU=; b=CNnd4biDRTlpugOR+JeLwdaPq06suwFCr1Tpbdb6GDqNuerNxu6UxPy7tPsmsRcwFR GalKdOyppHefB/clrjruuKdEpxpFzBoFhp2IjSuFpjSysdHgnG+iOKLBZWgwXc8WbSnU d8zfSnT19SD8mM8MRvPj4Zc1EXymHDL61g1WcJN0Bm+VKqq0RHIhFxA0DsbeW5zZev3c s/DDSp2jwenXQQaABBvfQC2avtfAA4E3JQCD75o4chybpZXYgTwiwQLyKx36Gk8460dg Hp4hdG1iw/7JOBrOCTNwoQYqi7FRMlqTL+ecr/W+YPvAKn3Sbb+7/TD55EYe/aM5jejR J+GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=8dNzZoo6BwE+y+2RELR9+ATC7jomEHgy2WoRWlyh2FU=; b=NG8HjMa5Oxf3xYliPu3rwMiphp9veWjlWW5MCxZngwXMeIKaU/UCjAWQEnoiNze56z h37iD4qCQIdBWMe7z3oreB4q8ATALxXeCLHLl9/vj3zQbqVP1exD/sUhxQGQLR10c/zo 4Op1tY9759GjhKkEtrOeL4x5ER+ThjTIt05cf9m9ipCrzmPShLg8fWvsa2oVpXrDJzVD 5EV2t8xeGwHAId1sAcZIKx4AppUSjFXilyXWN3fZuFCmLHt1zFWwxnldPU/H0pwSos6x kZWY4r17chmaaxP15lPyIdG+C7I26qUPaNAT+a/tLyj+qCWmBqiHJAH9VHSBuG4NeeL8 vQvQ== X-Gm-Message-State: AGi0PuaR37dhyboPQzGwlpuPLhJsKsug67LX3JvHIMdpRr6AEHT3cqjA knh/CVG8fbWjMT0wi+FeBB2+F9QvsuPPRtfHNSYsJqvg X-Received: by 2002:a92:dc0d:: with SMTP id t13mr28368019iln.287.1588102801835; Tue, 28 Apr 2020 12:40:01 -0700 (PDT) MIME-Version: 1.0 References: <20200427145435.13151-1-greearb@candelatech.com> <1e1664b6-1998-5a4b-67ba-09113ec8d3a7@candelatech.com> <87k11zv1ux.fsf@toke.dk> In-Reply-To: <87k11zv1ux.fsf@toke.dk> From: Dave Taht Date: Tue, 28 Apr 2020 12:39:50 -0700 Message-ID: Subject: Re: [PATCH] ath10k: Restart xmit queues below low-water mark. To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Cc: Ben Greear , Steve deRosier , linux-wireless Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Apr 28, 2020 at 12:37 PM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > > Ben Greear writes: > > > On 04/28/2020 07:56 AM, Steve deRosier wrote: > >> On Mon, Apr 27, 2020 at 7:54 AM wrote: > >>> > >>> 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. > >>> > >> > >> Hey Ben, > >> > >> Did you do any testing with this patch around latency? The nature of > >> the thing that you fixed makes me wonder if it was intentional with > >> respect to making WiFi fast - ie getting rid of buffers as much as > >> possible. Obviously the CPU impact is likely to be an unintended > >> consequence. In any case, I don't know anything for sure, it was just > >> a thought that went through my head when reading this. > > > > I did not, but on average my patch should make the queues be less full, > > so I doubt it will hurt latency. > > I would tend to agree with that. Well, I don't, as it's dependent on right sizing the ring in the first plac= e. But testing is in order! :) > -Toke > > >>> 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/wire= less/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/w= ireless/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 =3D=3D htt->max_num_pending_tx - 1) > >>> + if ((htt->num_pending_tx <=3D (htt->max_num_pending_tx / 4)) = && htt->needs_unlock) { > >>> + htt->needs_unlock =3D 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 =3D=3D htt->max_num_pending_tx) > >>> + if (htt->num_pending_tx =3D=3D htt->max_num_pending_tx) { > >>> + htt->needs_unlock =3D true; > >>> ath10k_mac_tx_lock(htt->ar, ATH10K_TX_PAUSE_Q_FULL); > >>> + } > >>> > >>> return 0; > >>> } > >>> -- > >>> 2.20.1 > >>> > >> > > > > -- > > Ben Greear > > Candela Technologies Inc http://www.candelatech.com --=20 Make Music, Not War Dave T=C3=A4ht CTO, TekLibre, LLC http://www.teklibre.com Tel: 1-831-435-0729