From owner-freebsd-arch@FreeBSD.ORG Fri Oct 7 10:22:33 2005 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF08316A41F for ; Fri, 7 Oct 2005 10:22:33 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEF0F43D49 for ; Fri, 7 Oct 2005 10:22:32 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.3/8.13.3) with ESMTP id j97AMUSl039077 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Oct 2005 14:22:31 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id j97AMUEc039076; Fri, 7 Oct 2005 14:22:30 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 7 Oct 2005 14:22:29 +0400 From: Gleb Smirnoff To: dima <_pppp@mail.ru> Message-ID: <20051007102229.GL14542@cell.sick.ru> References: <20051007094712.GK14542@cell.sick.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i Cc: arch@FreeBSD.org Subject: Re: [REVIEW/TEST] polling(4) changes X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Oct 2005 10:22:33 -0000 On Fri, Oct 07, 2005 at 02:18:42PM +0400, dima wrote: d> The loop body should really look like d> if( mtx_try_lock( &iface_lock[i] ) ) { d> pr[i].handler( pr[i].ifp, POLL_ONLY, count ); d> mtx_unlock( &iface_lock[i] ); d> } d> I skipped this first to make the idea clearer. Yes, this approach should be better. d> > Really we do not have several kernel threads in polling. netisr_poll() is always d> > run by one thread - swi1:net. Well, we have also idle_poll thread, but it is d> > very special case. Frankly speaking, it can't work without help from netisr_poll(). d> > The current polling is designed for a single threaded kernel, for RELENG_4. We d> > can't achieve parallelization with strong redesign. The future plans are to create d> > per-interface CPU bound threads. The plans can change. You are welcome to help. d> d> idle_poll can significantly increase network response time. I'd suggest per-CPU (not per-interface) threads. This would keep user_frac code much simpler. No, please don't spawn more idle_poll threads! :) As said, the idle_poll thread can't work on its own. idle_poll needs netisr_poll() to push it sometimes out of the priority pit. It is described in first mail of this thread. d> Not sure about the coding help in the next weeks. My current project is on the pre-release stage and the kid is going to be born soon. I can join a bit later though. There is no promises in the free project. Join when you can. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE