From owner-cvs-src@FreeBSD.ORG Tue Sep 6 06:18:33 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 414D516A41F; Tue, 6 Sep 2005 06:18: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 8498943D45; Tue, 6 Sep 2005 06:18: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 j866ITuM047203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 6 Sep 2005 10:18:29 +0400 (MSD) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.3/8.13.1/Submit) id j866ISBl047202; Tue, 6 Sep 2005 10:18:28 +0400 (MSD) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Sep 2005 10:18:28 +0400 From: Gleb Smirnoff To: Luigi Rizzo Message-ID: <20050906061828.GQ41863@cell.sick.ru> References: <200509051602.j85G2Bpo090258@repoman.freebsd.org> <20050905094341.A23343@xorpc.icir.org> <20050905180050.GB41863@cell.sick.ru> <20050905141451.A27290@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20050905141451.A27290@xorpc.icir.org> User-Agent: Mutt/1.5.6i Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_poll.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Sep 2005 06:18:33 -0000 Luigi, On Mon, Sep 05, 2005 at 02:14:51PM -0700, Luigi Rizzo wrote: L> On Mon, Sep 05, 2005 at 10:00:50PM +0400, Gleb Smirnoff wrote: L> > On Mon, Sep 05, 2005 at 09:43:41AM -0700, Luigi Rizzo wrote: L> > L> gleb, could you document how you are using the PRF_RUNNING L> > L> and PRF_LEAVING flags that you added ? L> > L> > Ok, I will. Tomorrow or today. L> > L> > L> also i am unclear on whether there is a race condition involving L> > L> unregistering poll (second part of netisr_poll()) L> ... L> > Yes, the race is possible and known to me, though I haven't L> > triggered it. To fix it the plan is to turn polling off/on L> > functionally, not on the next tick or on next interrupt. L> > This idea has already been implemented in DragonFlyBSD. L> > L> > Since the race is not runtime one, and requires idle_poll to be L> > enabled, which is not default setting, we can live with it. L> L> as long as known issues are mentioned, i am fine with it. L> but please do add comments in the code to mention them, because L> it is (to me at least) very hard sometimes to figure out L> races etc and it saves a lot of time to read these notes. L> L> > With current design really we get a very small parallelizm in three L> > threads: netisr, idlepoll, trap. This was not the main aim. L> L> idlepoll is one per cpu if i am not wrong. similarly for trap. L> In my view, at least the initial design should aim at having only L> one polling thread at any time. I.e. at least for poll-in-trap, L> if it finds the poll_mtx busy just give up, someone is already working on it; L> not sure yet on how to arbitrate idlepoll threads The idlepoll thread is single. The idea about trylocking the poll_mtx looks good to me, I'll do it after discussing with ru, rwatson, pjd, ... -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE