From patchwork Wed Mar 27 16:29:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10873755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F94C186D for ; Wed, 27 Mar 2019 16:29:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06DC328857 for ; Wed, 27 Mar 2019 16:29:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEB9F28897; Wed, 27 Mar 2019 16:29:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6957328857 for ; Wed, 27 Mar 2019 16:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=h1xaK/d7QdQJZD7NazPwAckHDqqI36fQdDupuH80fHw=; b=GdOq8QSy54tdQJ OPIre0PYq8x1jz6x9rgCnpYhK/GWGAxCQO/Sf3T4rc8f0UkkrdDEN99iX1FWuQ7sUZb2qJXA9yE6k nOhd2giAS+sSlNf0y/5COk+N7Y49xPgx812N4BasE5hY+xkrGB01bYMG8OmDfLed+3+p8eBHckvub 2IEKJjkrWFt2kCJK1RmNLQ5SgO5iXTGMsmEDr2hxW8+9R80otgePz+DtRaMfjcqNIMUzyo4LVStHM BZkvuKfYQyagaML9p0lDLKCROUkkSALQ2SN8xvvuf7G7uBSUmSVYPkXhrff6wnZal/MSa9zkwhDFJ Q7VgxUNOuRiV0GVljt0Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9BQn-0003WF-2w; Wed, 27 Mar 2019 16:29:37 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9BQk-0003VW-4h for ath10k@lists.infradead.org; Wed, 27 Mar 2019 16:29:35 +0000 Received: by mail-lj1-x243.google.com with SMTP id k8so14970206lja.8 for ; Wed, 27 Mar 2019 09:29:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yv8EDXWyr+1N0XQBFTta9F1B9/FtYnuS+JgnIeALqs8=; b=Jj3rlVCm33GPUcfG6JNX+gYt0euERGPOBnweDrrhB3Bldp14j3NLnXC913N4d3a7nl GTOpIAAo4kMLIxpqZ4bm04TFIumWLEGNmBxmAuPLK2twKyhZ+PcIl5Y6k1/A0T93tpsr pm80Jbg6Cf2Xc5+TxNt/sg8ddk0oxoiAkmgrfEW2uIk4W1ouhmWsj26xQt4R3o3Bsl96 18tisTf+GXBBDP5q8sa13YU4CKko5ogWME50rWqW793/DAAV+CcecxM6+FU3hZlJbqdf 1fmLci1k6q4zg2MNEhvIj+PpoEsfq3AKUUtp3N7kxM8f2j1LdhvZ7NmdvKlpF9Os3j6o 1+wQ== 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:date:message-id:mime-version :content-transfer-encoding; bh=yv8EDXWyr+1N0XQBFTta9F1B9/FtYnuS+JgnIeALqs8=; b=e7Ww4yMeXIEBmD67oHh72RnKZYtcu49bBTYehbWpwzfmWY8BNVBR+/T9femwWIxhKA G12C8AMRGzQrmVmMCxNKPe2KZg/kdifWdVMfE9+qBkeg1Q2Q5ja0KPhnng7UbvEs3Fkk PqTqt9C/Yp9BLC5kHghmE/dWwUPFElmcMeQgzlwcZIR2PH+Nd4nVCmBW1sOjBf1nerZy hgRuO2wsCJNFSPh7x/xQUJq0Zuk7XeIBJ/HBTdhUVnsNUZVeKzhlxkm05Lk1mlTINhUk NxZK009skmmaDsga1DqqaTFgO/LSgmmjfkDsJb9CXvzaNUALnQz5RGf/AWuWl5wbkO39 0oJQ== X-Gm-Message-State: APjAAAXtnfHfEOLsAeqoooFJeocYN0hyoLvfRkCt9hjX8XefkfQp5C6h UAwlwoHztvsw/HZ8PQeLMeYX/rJK X-Google-Smtp-Source: APXvYqwOKZ3jTMBK6CzNicS6ws91rTeK1akuo+jzzRkEPsuzkvlqJs5MawIyc3R85Rf5tnEHyAFJfA== X-Received: by 2002:a2e:20f:: with SMTP id 15mr5997942ljc.149.1553704170356; Wed, 27 Mar 2019 09:29:30 -0700 (PDT) Received: from localhost.localdomain (81-233-89-221-no75.tbcn.telia.com. [81.233.89.221]) by smtp.gmail.com with ESMTPSA id x76sm4827057ljb.17.2019.03.27.09.29.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Mar 2019 09:29:29 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [PATCH] ath10k: remove iteration in wake_tx_queue Date: Wed, 27 Mar 2019 17:29:06 +0100 Message-Id: <20190327162906.6010-1-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190327_092934_183980_FBF867B7 X-CRM114-Status: GOOD ( 10.64 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erik Stromdahl , yiboz@codeaurora.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Iterating the TX queue and thereby dequeuing all available packets in the queue could result in performance penalties on some SMP systems. The reason for this is most likely that the per-ac lock (active_txq_lock) in mac80211 will be held by the CPU iterating the current queue. This will lock up other CPUs trying to push new messages on the TX queue. Instead of iterating the queue we fetch just one packet at the time, resulting in minimal starvation of the other CPUs. Reported-by: Yibo Zhao Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/mac.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index b73c23d4ce86..c9e700b844f8 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4356,7 +4356,6 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) { struct ath10k *ar = hw->priv; - int ret; u8 ac; ath10k_htt_tx_txq_update(hw, txq); @@ -4369,11 +4368,9 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw, if (!txq) goto out; - while (ath10k_mac_tx_can_push(hw, txq)) { - ret = ath10k_mac_tx_push_txq(hw, txq); - if (ret < 0) - break; - } + if (ath10k_mac_tx_can_push(hw, txq)) + ath10k_mac_tx_push_txq(hw, txq); + ieee80211_return_txq(hw, txq); ath10k_htt_tx_txq_update(hw, txq); out: