From patchwork Fri Feb 12 06:10:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 8287751 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 78DFA9F3CD for ; Fri, 12 Feb 2016 06:11:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 91F9B203B0 for ; Fri, 12 Feb 2016 06:11:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF96C203AE for ; Fri, 12 Feb 2016 06:11:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aU6x6-0004GU-OS; Fri, 12 Feb 2016 06:11:36 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aU6x4-0004Cp-Op for ath10k@lists.infradead.org; Fri, 12 Feb 2016 06:11:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1455257494; x=1486793494; h=from:to:cc:subject:date:message-id:mime-version; bh=9tFnqkbX9+C3UjgzA8GmitE3eR72Uq812brGk4spYdM=; b=BCaW7x/p52BsPsJRKFeeQhmWqKm9I8XVy3SrDvy0jUi87kHpWNjHh4zM Kg2uxDvK/+xZO5Xgp9SxEEGAT9lP6Fr5AabVmPbq/3UnWopp60Lf7UGfD kxQXdLOrPrD23ffHpA1DRWzxoE9eFK+y+/YOZyHtKAGMzCum26I2Skrvq E=; X-IronPort-AV: E=Sophos;i="5.22,435,1449561600"; d="scan'208";a="262691031" Received: from ironmsg02-l-new.qualcomm.com (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Feb 2016 22:11:13 -0800 X-IronPort-AV: E=McAfee;i="5700,7163,8072"; a="636950293" Received: from nasanexm01h.na.qualcomm.com ([10.85.0.34]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 11 Feb 2016 22:11:12 -0800 Received: from APSANEXR01B.ap.qualcomm.com (10.85.0.37) by NASANEXM01H.na.qualcomm.com (10.85.0.34) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 11 Feb 2016 22:11:12 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by APSANEXR01B.ap.qualcomm.com (10.85.0.37) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 11 Feb 2016 22:11:07 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Fri, 12 Feb 2016 11:41:04 +0530 From: Rajkumar Manoharan To: Subject: [PATCH 1/2] ath10k: reduce rx_lock contention for htt rx indication Date: Fri, 12 Feb 2016 11:40:58 +0530 Message-ID: <1455257459-13343-1-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.7.0 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) To APSANEXR01B.ap.qualcomm.com (10.85.0.37) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160211_221134_888168_82892681 X-CRM114-Status: UNSURE ( 8.71 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.3 (-------) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Rajkumar Manoharan Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Received frame indications are queued into a skb list and latest processed by txrx tasklet. This skb queue is protected by htt rx lock. Since the entire rx processing till delivering frame to mac80211 and replenish tasks are processed under rx_lock protection, there might be some delay in queuing newly received rx frame into that list on multicore systems. Optimize this by using skb list lock while accessing rx completion queue instead of htt rx lock. Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath10k/htt_rx.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index cc957a6..bedd8c3 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2011,9 +2011,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) break; } case HTT_T2H_MSG_TYPE_RX_IND: - spin_lock_bh(&htt->rx_ring.lock); - __skb_queue_tail(&htt->rx_compl_q, skb); - spin_unlock_bh(&htt->rx_ring.lock); + skb_queue_tail(&htt->rx_compl_q, skb); tasklet_schedule(&htt->txrx_compl_task); return; case HTT_T2H_MSG_TYPE_PEER_MAP: { @@ -2111,9 +2109,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) break; } case HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND: { - spin_lock_bh(&htt->rx_ring.lock); - __skb_queue_tail(&htt->rx_in_ord_compl_q, skb); - spin_unlock_bh(&htt->rx_ring.lock); + skb_queue_tail(&htt->rx_in_ord_compl_q, skb); tasklet_schedule(&htt->txrx_compl_task); return; } @@ -2174,16 +2170,18 @@ static void ath10k_htt_txrx_compl_task(unsigned long ptr) dev_kfree_skb_any(skb); } - spin_lock_bh(&htt->rx_ring.lock); - while ((skb = __skb_dequeue(&htt->rx_compl_q))) { + while ((skb = skb_dequeue(&htt->rx_compl_q))) { resp = (struct htt_resp *)skb->data; + spin_lock_bh(&htt->rx_ring.lock); ath10k_htt_rx_handler(htt, &resp->rx_ind); + spin_unlock_bh(&htt->rx_ring.lock); dev_kfree_skb_any(skb); } - while ((skb = __skb_dequeue(&htt->rx_in_ord_compl_q))) { + while ((skb = skb_dequeue(&htt->rx_in_ord_compl_q))) { + spin_lock_bh(&htt->rx_ring.lock); ath10k_htt_rx_in_ord_ind(ar, skb); + spin_unlock_bh(&htt->rx_ring.lock); dev_kfree_skb_any(skb); } - spin_unlock_bh(&htt->rx_ring.lock); }