From owner-freebsd-arch@freebsd.org Mon Aug 31 00:24:49 2015 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7154D9C66EF for ; Mon, 31 Aug 2015 00:24:49 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E4761863; Mon, 31 Aug 2015 00:24:49 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by iod35 with SMTP id 35so12334426iod.3; Sun, 30 Aug 2015 17:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=yMrqHCW6ifCf0bTBACmQnwqe9J1FW2+cly1O/djyelA=; b=UzY4wF9rcqF8DRgN45GQBZcD63Eyx4gFqFZMWKuuCBpjb5s0b4ZIelLmUXIorpS56p 6um9PU2NjpLds3UEuJBADtqJQvhF55nSGCiEarJ5I3YnZGUk1z+izRDUXaRLCLjS0nTe BtZWXAWH04E4hmIan1hSomi9Mmh7NnfB8NUxsazyPpo7DfAxnSOGVfCC9GVCuzO4IY5C ScpHKU0RDECe9ypSCJhWhqKUleGjHeCOtvjFr2m981eAFuz+ahEICSF3QRdZ/LDlaHZF XK5aLr9GoXNHXvPyzzHSV9xQ7Vze2uK/FcVpaF+jZhSroi6uqvk+Lia6t3I4guPF6ygR +4oA== MIME-Version: 1.0 X-Received: by 10.107.154.212 with SMTP id c203mr3370414ioe.123.1440980688639; Sun, 30 Aug 2015 17:24:48 -0700 (PDT) Received: by 10.36.28.208 with HTTP; Sun, 30 Aug 2015 17:24:48 -0700 (PDT) In-Reply-To: <20150831000003.GJ33167@funkthat.com> References: <55DDE9B8.4080903@freebsd.org> <20150828184800.GE33167@funkthat.com> <20150831000003.GJ33167@funkthat.com> Date: Sun, 30 Aug 2015 17:24:48 -0700 Message-ID: Subject: Re: Network card interrupt handling From: Adrian Chadd To: John-Mark Gurney Cc: Jack Vogel , Sean Bruno , "freebsd-arch@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2015 00:24:49 -0000 On 30 August 2015 at 17:00, John-Mark Gurney wrote: > Adrian Chadd wrote this message on Fri, Aug 28, 2015 at 12:41 -0700: >> [snip] >> >> Well, the other big reason for doing it deferred like this is to avoid >> network based deadlocks because you're being fed packets faster than >> you can handle them. If you never yield, you stop other NIC >> processing. > > You snipped the part of me asking isn't the interrupt thread just the > same interruptable context as the task queue? Maybe the priority is > different, but that can be adjusted to be the same and still save the > context switch... > > There is no break/moderation in the taskqueue, as it'll just enqueue > itself, and when the task queue breaks out, it'll just immediately run > itself, since it has a dedicated thread to itself... So, looks like > you get the same spinning behavior... > >> People used to do run-to-completion and then complained when this >> happened, so polling was a thing. > > Maybe when using PCI shared interrupts, but we are talking about PCIe > MSI-X unshared interrupts. Well, try it and see what happens. You can still get network livelock and starvation of other interfaces with ridiculously high pps if you never yield. :P -adrian