Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4374700ybz; Tue, 28 Apr 2020 10:11:57 -0700 (PDT) X-Google-Smtp-Source: APiQypLXy/ewD7Z+FMK0mIeQOBzHWFXIRf6d0pAdEWwXP3hNX3JH7u8iaREe0IFTAJtsOro1exoO X-Received: by 2002:a50:950a:: with SMTP id u10mr24353474eda.45.1588093917139; Tue, 28 Apr 2020 10:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588093917; cv=none; d=google.com; s=arc-20160816; b=LQPTQxNH/6+rUbE4cmDewDxT0oZfGnbwajSNPH/Xn+LkNXJizVfOsyTypg+xc/LCdu EzODH6NiWjVWkKIPd12c7jhnl8avdhJ/IxU4B5WX+oYUGQ/MUtM0JEe4iVihqGx2Y+df WOuYmLzvVMTMDAG/gGO4pI/fSv4o46eYwF2ubNq48VTQJJVG7dgaTaOodzcLqge7uZPo sG2L13WjLpeLJrsDtGRuGKVX5MR7LkiRCbE6ciew7RTUS3HRxFIQaRVy+pfkma38iyOO azbqcBF0HDw5djbtVgFq+u+IlRdqW10CWxwEC+Zvp1brpmrKGzDSXjdmdKp6BrZH86wo hNJQ== 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=wWnZWc2eIL5m4prB0tQSVe9ACu/1Y9skaMpnFim491o=; b=Jp87n1jzM9lCEB/QF3+Vk1+l3uR+Hw+Z2gj2WKsZ8FvvzEghcvtXtUlx0Pmi1pB+5H aQXTbrucPzYTLyYR1ktye3N0dKIcOJUbzfc9XnybYuLGV2oVpeRMU4mYEnYjFda2pePx dfXer8NKmZjC54KV207dw26RpSsSylpe5YPuq0RBQEp6blVusuFsN6wkNhG0EegFi29a RkC/4fhmHMloikdyleklEABrh9YjKdmvIfQdecSSw0m+jo+U/lL8EGFV0oQ+/hdwfOy4 t4eoaRiZ06se809J7sSrph7qZ409QxO70pEFC9x21dU4A8p4e59VzQBj0o8fiZ3hKChe IeVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bB4KYtRf; 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 la2si2193884ejb.371.2020.04.28.10.11.17; Tue, 28 Apr 2020 10:11:57 -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=bB4KYtRf; 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 S1728335AbgD1RKs (ORCPT + 99 others); Tue, 28 Apr 2020 13:10:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726406AbgD1RKs (ORCPT ); Tue, 28 Apr 2020 13:10:48 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D922AC03C1AB for ; Tue, 28 Apr 2020 10:10:47 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id s10so21192480iln.11 for ; Tue, 28 Apr 2020 10:10:47 -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=wWnZWc2eIL5m4prB0tQSVe9ACu/1Y9skaMpnFim491o=; b=bB4KYtRfxr9FzpWQRm0TNW1208Smkh4d62Jr6+w7oIdOwI4RCn1SngORdP3cQ600ho YnzmMilUMTCSM+hrytDR5G5WVeXQsxGjyyUQiiJycEbWxBQ0tcFqmnjd14BkpVj2vFi/ 8+mFtgjUecwVWu/ThM9+WxPk2XgVIxjMigT7uskL8giD22zmKhZFgXvK3lf/tVKmGhRk P9D8o0eQZV5x40Y+EhqLQZMIxsKZWGW+f8P3OH+aGzH4YKzjivuTTFrH8RUA+tzc1LvN a6euuQcEb8e7JIlFPHkaKGDUN3lRHz8VhvgxgUbfFIn9IR9XaXocQPKymv7j+k2C+Au+ t+PQ== 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=wWnZWc2eIL5m4prB0tQSVe9ACu/1Y9skaMpnFim491o=; b=jFs3WDDm0aGVhac8ViTpcQWZUPqtN7dTNMxDAwo+2emRnjgW2BCf27XFx4btZ0OoGg 9abywLvmgUf18kMHyrHVtC6o8dG1P2o8aKVHU/VOJwyW63SrxmNLZ5KFGZ2s5zylGGoH 5QdR0KYvkkMvgEgqlLK4CSSH8FQjPEBCyF0qS/O+TuJx5OaC11DzXxz3T5bHma5aJ0S9 lnmgEEh3wVz83UB3IQbkbkTop9RgY0+Q9zgv8tYcCe9EglLP6yN1GNofkJnELtV0vgT8 u4UCcFK3ahHtuKFQx1ruRiFjexGtmyjmieY2btzheIN+jB2PNSOhquBIFFYGPWrJBazL wTRw== X-Gm-Message-State: AGi0PuYm2nyR/7TCq5KTRbBwbYlZTtZBfHbRStGfV57EQ23b0eZHRxfn BHJeaHy2w8ysrCXRk+F7j6EaWXYgdoiefIWxxpI= X-Received: by 2002:a92:dccf:: with SMTP id b15mr26343705ilr.246.1588093847178; Tue, 28 Apr 2020 10:10:47 -0700 (PDT) MIME-Version: 1.0 References: <20200427145435.13151-1-greearb@candelatech.com> In-Reply-To: From: Dave Taht Date: Tue, 28 Apr 2020 10:10:35 -0700 Message-ID: Subject: Re: [PATCH] ath10k: Restart xmit queues below low-water mark. To: Ben Greear Cc: Steve deRosier , linux-wireless , Make-Wifi-fast 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 9:35 AM Ben Greear wrote: > > > > On 04/28/2020 09:27 AM, Dave Taht wrote: > > On Tue, Apr 28, 2020 at 7:56 AM Steve deRosier wro= te: > >> > >> 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 note that I'd prefer a BQL-like high/low watermark approach in > > general... bytes, not packets, or better, perceived > > airtime in a revision of AQL... > > > > ... but we'll try this patch, thx! > > Is there a nice diagram somewhere that shows where the various > buffer-bloat technologies sit in the stack? I suspect such should > be above the txqueue start/stop logic in the driver that I mucked > with, and certainly the old behaviour has no obvious tie-in with > any higher-level algorithms. There are some good diagrams of the new queue stuff buried in toke's book and online papers, notably "ending the anomaly" https://bufferbloat-and-beyond.net/ Plug: They just did a print run, and it makes for good bathroom reading. There's also a preso on it around here somewhere. That said, let's see... there's some rants in this: http://flent-fremont.bufferbloat.net/~d/broadcom_aug9.pdf and here ... https://conferences.sigcomm.org/sigcomm/2014/doc/slides/137.pdf but that's mostly about what was wrong at the time. Definitely! revising this piece would be a good idea in light of modern developments and increased knowledge. https://www.linuxjournal.com/content/queueing-linux-network-stack IMHO "how to use AQL" is underdocumented at the moment. I'd hoped to produce some after we successfully got the iwl drivers to use it, but we haven't got around to it, and merely getting the ath10k using it (really really) well, has eaten into my ax200 time..... > > I doubt my patch will change much except in pathological cases where > the system is transmitting frames fast enough to fully fill the tx buffer= s > and also loaded in such a way that it can process just a few tx frames > at a time to keep bouncing to full and not full over and over. > > Thanks, > Ben > > -- > 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