Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5992000ybe; Tue, 17 Sep 2019 17:36:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjU7dtr+fE+l8MSknh5AwD7SOfrnJ8m2DmrdQyaz3WGy8CcZWUbXNcvEV+2T6YvJtEVLBw X-Received: by 2002:aa7:c759:: with SMTP id c25mr7558486eds.15.1568767003158; Tue, 17 Sep 2019 17:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568767003; cv=none; d=google.com; s=arc-20160816; b=q/YRdsdiQ9Bu2ez9s/b9gV8aMmamXL/WLmY4fPJ/S55B/+3IZMTo5pcIWniS/RBNwB QHxz4JELaloj2NAfs7aCILy+O18VdMVuE74M5zARbgfMgH8HusumOFA5rynAFVym2qB2 opAjPj6sAN1Jo75KkNgl9NE7fwCRkTf1XG/Rayy2eYq5gG8UIq7+5HAKB/IBeZ6l1EFi zEdEjJII8E9EUrbSKM65D1IawPSmgClO3hO68Lf0oTalvZKANQe2ruk1WnKl2QVqqq+v vp0flHH+AUab2/v4B6RrTvBRCIOf05UZU5sIthDrjlT5L+guV3BfuBKARlr9gGJuOFyJ mVYw== 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:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=JVaGqS/TFjKhE/EptfKk75z9gnGR8vTzonot4HX3CsY=; b=UqvySXKX/SwyEEnfaJsLH0Hb4muaYWzBEESXO9vEPkCheoXqAPYEj8HwcGMlhQ7jAq e3GsHhG7IlNeeqrspBia8rRyIkFHzSCSx3ZTCqSR48pkT7n8yHdyu+BBBdNJVee0YbWn ITBwYeTc3tNXVjh7isXAv4JZ35K0Xb0ygS+WR4ulz5ovfEnDgjtdMnQt/wSRhXCiEnzc pT6va/fyM9q9fVEjXTHfvMkZ0mNK4Ft5wdEYuO56gt4OhZMGnyoKcIkLh1pO1JDxPKrJ p8OhP7PIPB3Zg8oA0kIAhKBF7zfiV7CEb9KUtg9UxHj46B9A3PJMSRoy29RBdap51nSm NVGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=S8Vbwkn4; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w17si2007197ejf.362.2019.09.17.17.36.18; Tue, 17 Sep 2019 17:36:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=S8Vbwkn4; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728295AbfIQVbO (ORCPT + 99 others); Tue, 17 Sep 2019 17:31:14 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:23798 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728051AbfIQVbO (ORCPT ); Tue, 17 Sep 2019 17:31:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1568755872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JVaGqS/TFjKhE/EptfKk75z9gnGR8vTzonot4HX3CsY=; b=S8Vbwkn42xJr/PMem1xChyydVrwxuG/NB2Mv26MscSWSAkd3U1Le5aIQlAWYMo7kmF2yMx gJQ95Z+T4wK07RO/ZFFpjy6cM5qzyqeeS5ycUxQ88WUwuX1HdoSF3OR4Dw/dXSNdoagngC rfXOkHk51uv2td2FXSDAL/Yy8RQiriw= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-196-zz7xyQe-OpefX9rBv39ONA-1; Tue, 17 Sep 2019 17:31:11 -0400 Received: by mail-ed1-f71.google.com with SMTP id f9so3019350edv.1 for ; Tue, 17 Sep 2019 14:31:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=JVaGqS/TFjKhE/EptfKk75z9gnGR8vTzonot4HX3CsY=; b=GM6ohVKQwVLt9X3LIUND2vzHoZRBsIMM/cIqx4NYZYwitZEWqN1VTQNGyGRPmFhPdS mMHBaS/Oqgz137lxJryMocYancGzxAIOO5FBUXhy53ckt5UMKrAR/kZbW6qCXxFWutBA oMB95uqoXORwyRqQDy6na/WwM0GV9ZtfwfI0iSFrCs7tIJN+iIzSikSLllO/dfOQcUar vffzAsVyPy5O/KotV7rsSoy6XQIElRB4pTqUTB5DZP/aJbWZgQbSuSF0KsEU3CrLKkU1 EUOn+cg7wYUh/eXUMEUXnAEeZ46piOnmvfP6JXF/WdrtLYaXTWjFRel9L1sbR+2Kem+P Nwqg== X-Gm-Message-State: APjAAAWSVGIu39HgIGtmYh4t7WqHOFb+s03UOf5i7OuA7NTc9iHykhES /PfVKgnOXpYyPqcSKWzqHod2uAvG7tguXQmLNvUPn/VvOOKjP3uJS1TGo+tvUcUeiK9Po8w7e7C TZiR10BG5f2zOxhysgytAch8we6U= X-Received: by 2002:a05:6402:78b:: with SMTP id d11mr4964741edy.14.1568755869725; Tue, 17 Sep 2019 14:31:09 -0700 (PDT) X-Received: by 2002:a05:6402:78b:: with SMTP id d11mr4964726edy.14.1568755869581; Tue, 17 Sep 2019 14:31:09 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([2a00:7660:6da:443::2]) by smtp.gmail.com with ESMTPSA id z39sm638848edd.46.2019.09.17.14.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2019 14:31:08 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 62B041800B9; Tue, 17 Sep 2019 23:31:08 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Yibo Zhao , ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org Subject: Re: [PATCH 1/4] mac80211: Switch to a virtual time-based airtime scheduler In-Reply-To: <1568639388-27291-1-git-send-email-yiboz@codeaurora.org> References: <1568639388-27291-1-git-send-email-yiboz@codeaurora.org> X-Clacks-Overhead: GNU Terry Pratchett Date: Tue, 17 Sep 2019 23:31:08 +0200 Message-ID: <87ftkuip9f.fsf@toke.dk> MIME-Version: 1.0 X-MC-Unique: zz7xyQe-OpefX9rBv39ONA-1 X-Mimecast-Spam-Score: 0 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 Yibo Zhao writes: > From: Toke H=C3=B8iland-J=C3=B8rgensen > > This switches the airtime scheduler in mac80211 to use a virtual time-bas= ed > scheduler instead of the round-robin scheduler used before. This has a > couple of advantages: > > - No need to sync up the round-robin scheduler in firmware/hardware with > the round-robin airtime scheduler. > > - If several stations are eligible for transmission we can schedule both = of > them; no need to hard-block the scheduling rotation until the head of t= he > queue has used up its quantum. > > - The check of whether a station is eligible for transmission becomes > simpler (in ieee80211_txq_may_transmit()). > > The drawback is that scheduling becomes slightly more expensive, as we ne= ed > to maintain an rbtree of TXQs sorted by virtual time. This means that > ieee80211_register_airtime() becomes O(logN) in the number of currently > scheduled TXQs. However, hopefully this number rarely grows too big (it's > only TXQs currently backlogged, not all associated stations), so it > shouldn't be too big of an issue. > > Signed-off-by: Toke H=C3=B8iland-J=C3=B8rgensen I'll note that this patch still has the two issues that Felix pointed out when I posted the RFC version. Namely: - The use of divisions in the fast path. I guess I need to go write some reciprocal-calculation code, since that is also an issue with the AQL patches I linked to before. - The fact that we don't count the airtime usage of multicast traffic, which with this series means that the vif TXQ will get priority over the others. I think we agreed to fix this by just adding an airtime v_t to the vif as well and use that for scheduling the TXQ. Does ath10k report airtime usage for multicast as well, or only for stations? -Toke