From owner-freebsd-arch Thu Jun 20 19:55:18 2002 Delivered-To: freebsd-arch@freebsd.org Received: from angelica.unixdaemons.com (angelica.unixdaemons.com [209.148.64.135]) by hub.freebsd.org (Postfix) with ESMTP id 05C2E37B411; Thu, 20 Jun 2002 19:55:08 -0700 (PDT) Received: from angelica.unixdaemons.com (bmilekic@localhost.unixdaemons.com [127.0.0.1]) by angelica.unixdaemons.com (8.12.4/8.12.1) with ESMTP id g5L2sq14040701; Thu, 20 Jun 2002 22:54:52 -0400 (EDT) X-Authentication-Warning: angelica.unixdaemons.com: Host bmilekic@localhost.unixdaemons.com [127.0.0.1] claimed to be angelica.unixdaemons.com Received: (from bmilekic@localhost) by angelica.unixdaemons.com (8.12.4/8.12.1/Submit) id g5L2soOJ040699; Thu, 20 Jun 2002 22:54:50 -0400 (EDT) (envelope-from bmilekic) Date: Thu, 20 Jun 2002 22:54:50 -0400 From: Bosko Milekic To: Terry Lambert Cc: Robert Watson , Seigo Tanimura , arch@FreeBSD.ORG Subject: Re: multiple threads for interrupts Message-ID: <20020620225450.A38506@unixdaemons.com> References: <3D128E50.CC2E0387@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3D128E50.CC2E0387@mindspring.com>; from tlambert2@mindspring.com on Thu, Jun 20, 2002 at 07:24:16PM -0700 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jun 20, 2002 at 07:24:16PM -0700, Terry Lambert wrote: > Robert Watson wrote: > > Unfortunately, I'm probably not really qualified to talk much about the > > swi stuff. But I can say I'd really like to have multiple netisr threads > > once the lock pushdown on IPv4 is more done :-). [...] > I can't understand the fascination with NETISR, however. It should > not exist in the first place. > > If any one doubts this, they really need to contact Van Jacobsen; > as Archie Cobbs, since he works at the same company as Van, if > you don't have contact information for Van yourself. > > -- Terry That's funny. I brought up the idea of processing network interrupts to completion at the developer summit and Jeffrey Hsu pointed out quite the opposite. He mentionned, and with very good reason, that the longer you spend running the stack like that as soon as you take the interrupt, the easier you'll be in livelock when you start taking a lot of interrupts (it was along those lines (I appologize, Jeffrey, if I didn't quote you exactly here)). If we have a pool of threads available to run the stack, though, perhaps we could do a sort of hybridized thing where we take the interrupt and switch to one of our available threads to process the packet, but once we hit the stack layer, re-enable the source and keep running. That way we could take another interrupt from the same source and we'll at most end up scheduling N threads (where N <= #cpus). To make matters worse, we could even decide to not re-enable the source when we switch to the N'th (final) thread - this way, we may end up preventing total livelock should we hit a storm. Once we run out of threads, we just set the need_service bit and return. Perhaps we'll find that the optimal number of threads to schedule at most at any given time will be something like N = #cpus/2. In any case, this is at best speculative and totally theoretical and we really can't argue these issues right now and expect to reach the correct solution. Once the network stuff is further done, we'll be able to revisit this. Regards, -- Bosko Milekic bmilekic@unixdaemons.com bmilekic@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message