From patchwork Mon Apr 21 23:14:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 4027661 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C1DD09F391 for ; Mon, 21 Apr 2014 23:15:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C582D20204 for ; Mon, 21 Apr 2014 23:15:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5EF3A202B8 for ; Mon, 21 Apr 2014 23:15:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754810AbaDUXPh (ORCPT ); Mon, 21 Apr 2014 19:15:37 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:51944 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754569AbaDUXPH (ORCPT ); Mon, 21 Apr 2014 19:15:07 -0400 Received: by mail-pa0-f47.google.com with SMTP id lj1so4231540pab.34 for ; Mon, 21 Apr 2014 16:15:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SsiplZ3T9TG6p3fwPMkE8dV0ak1YrdfqvZxM42bwhcI=; b=Vz1gpbuMQocaew+VX4tRsv8XZ1mQBCWOL9GmuZS0djbfPpDo4uZKjAiIB5u8owKmOI 8JoS6Afx+SzUUlYiHhbtmDEcFqwMaQPhr4nKOrsmzhGtzNyYDIwZIx70wyJdMmR7xVbA uy60V/0r6DuYBjxIWnvZeI2JymhSV6HmHvabPLXXBL+k4yUK6TXokccrjWf+0yYL8srS ROVLbPcGbhKfJfnwml3v0g7bMr5QkwoIRu36lYPASfVvf6m0In24GrKyqs/5pzJABopj bthRTfrZJxZ1z2e3RxaBMEP8rNlBLqi2ePS+iO09yfwE1nTLHp2j/bdl2Gu+o/IDRymZ wC3Q== X-Gm-Message-State: ALoCoQmyysBSRHhGSVv1+sj0iUThZ1Aqw7fR82dQSGe238mYZluEO/AZPsSbmQCrx1FQ8xrdht7q X-Received: by 10.66.149.102 with SMTP id tz6mr40861838pab.76.1398122107296; Mon, 21 Apr 2014 16:15:07 -0700 (PDT) Received: from tharvey-gw.gw (68-189-91-139.static.snlo.ca.charter.com. [68.189.91.139]) by mx.google.com with ESMTPSA id ba5sm80463865pbc.61.2014.04.21.16.15.04 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 16:15:05 -0700 (PDT) From: Tim Harvey To: linux-wireless@vger.kernel.org Cc: linville@tuxdriver.com, nbd@openwrt.org Subject: [PATCH 2/2] ath9k: add a recv budget Date: Mon, 21 Apr 2014 16:14:57 -0700 Message-Id: <1398122097-23544-2-git-send-email-tharvey@gateworks.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398122097-23544-1-git-send-email-tharvey@gateworks.com> References: <1398122097-23544-1-git-send-email-tharvey@gateworks.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Implement a recv budget so that in cases of high traffic we still allow other taskets to get processed. Without this, we can encounter a host of issues during high wireless traffic reception depending on system load including rcu stall's detected (ARM), soft lockups, failure to service critical tasks such as watchdog resets, and triggering of the tx stuck tasklet. The same thing was proposed previously by Ben: http://www.spinics.net/lists/linux-wireless/msg112891.html The only difference here is that I make sure only processed packets are counted in the budget by checking at the end of the rx loop. Signed-off-by: Tim Harvey Acked-by: Felix Fietkau --- drivers/net/wireless/ath/ath9k/recv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index e77a253..19df969 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c @@ -975,6 +975,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) u64 tsf = 0; unsigned long flags; dma_addr_t new_buf_addr; + unsigned int budget = 512; if (edma) dma_type = DMA_BIDIRECTIONAL; @@ -1121,6 +1122,9 @@ requeue: if (!flush) ath9k_hw_rxena(ah); } + + if (!budget--) + break; } while (1); if (!(ah->imask & ATH9K_INT_RXEOL)) {