From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753916AbZHZVlI (ORCPT ); Wed, 26 Aug 2009 17:41:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753726AbZHZVlF (ORCPT ); Wed, 26 Aug 2009 17:41:05 -0400 Received: from out02.mta.xmission.com ([166.70.13.232]:57291 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753478AbZHZVlE (ORCPT ); Wed, 26 Aug 2009 17:41:04 -0400 To: Francois Romieu Cc: David Dillow , Michael Riepe , Michael Buesch , Rui Santos , Michael B??ker , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] r8169: Reduce looping in the interrupt handler. References: <1251169150.4023.11.camel@obelisk.thedillows.org> <1251232848.9607.15.camel@lap75545.ornl.gov> <20090825221903.GA13630@electric-eye.fr.zoreil.com> <1251294974.14241.9.camel@obelisk.thedillows.org> <1251295175.14241.11.camel@obelisk.thedillows.org> <20090826213024.GA20428@electric-eye.fr.zoreil.com> From: ebiederm@xmission.com (Eric W. Biederman) Date: Wed, 26 Aug 2009 14:40:57 -0700 In-Reply-To: <20090826213024.GA20428@electric-eye.fr.zoreil.com> (Francois Romieu's message of "Wed\, 26 Aug 2009 23\:30\:24 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-XM-SPF: eid=;;;mid=;;;hst=in01.mta.xmission.com;;;ip=76.21.114.89;;;frm=ebiederm@xmission.com;;;spf=neutral X-SA-Exim-Connect-IP: 76.21.114.89 X-SA-Exim-Rcpt-To: romieu@fr.zoreil.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, m.bueker@berlin.de, rsantos@grupopie.com, mb@bu3sch.de, michael.riepe@googlemail.com, dave@thedillows.org X-SA-Exim-Mail-From: ebiederm@xmission.com X-SA-Exim-Version: 4.2.1 (built Thu, 25 Oct 2007 00:26:12 +0000) X-SA-Exim-Scanned: No (on in01.mta.xmission.com); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Francois Romieu writes: > Eric W. Biederman : > [...] >> It is a bit weird but it also means we aren't playing silly games >> with status inside the loop. So if we go through the loop we ack >> everything in status. > > I fear we have some longstanding problem anyway : > > 1. quiescent state > 2. packets are received > 3. rtl8169_interrupt schedules napi, clears IntrStatus and exits > 4. packets are received and some non-napi event happens > 5. rtl8169_interrupt wakes up, reads IntrStatus and goes on... > 6. rtl8169_poll wakes up, processes Rx and Tx napi events and goes on... > 7. tp->intr_mask still equals ~tp->napi_event : rtl8169_interrupt > handler does not even try to schedule napi. > 8. more packets are received > 9. rtl8169_interrupt clears IntrStatus > a. rtl8169_poll reenables napi scheduling, updates IntrMask and exits > b. rtl8169_interrupt reads a perfectly clean IntrStatus and exits That would not surprise me. Right now I really don't have much more test bandwidth. So I tried for something simple that would address my problem without fundamentally changing the already tested logic. I am not seeing any of the weird corner cases where we get confused. The changes to fix that problem is totally killing my ability to use the NIC, because it loops way to much. Perhaps we should unconditionally ack everything after changing the interrupt mask? If that would prevent races it sounds like a simple fix. Eric