From owner-freebsd-hackers Fri Feb 1 4:18:37 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from falcon.prod.itd.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id 3603237B41D for ; Fri, 1 Feb 2002 04:18:28 -0800 (PST) Received: from pool0081.cvx40-bradley.dialup.earthlink.net ([216.244.42.81] helo=mindspring.com) by falcon.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16Wcdz-0005J6-00; Fri, 01 Feb 2002 04:18:16 -0800 Message-ID: <3C5A8781.3FFCA6B4@mindspring.com> Date: Fri, 01 Feb 2002 04:18:09 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Luigi Rizzo Cc: Alfred Perlstein , Mike Silbersack , Storms of Perfection , thierry@herbelot.com, replicator@ngs.ru, hackers@FreeBSD.ORG Subject: Re: Clock Granularity (kernel option HZ) References: <20020131172729.X38382-100000@patrocles.silby.com> <3C59E873.4E8A82B5@mindspring.com> <20020201002339.C48439@iguana.icir.org> <20020201002835.I18604@elvis.mu.org> <20020201004658.A48810@iguana.icir.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Luigi Rizzo wrote: > but exactly because of this reason, the overhead of netisr should > be less and less relevant as the processing increases. Not really. You are barriered up and down, and in any request/response, you won't be able to process both in the same NETISR, it will take (at least) 2 NETISR to do the work; likely 5 (see my example 1K static page server for HTTP). > Unless of course you end up in livelock, in which case performance > drops to 0 without processing-to-completion, and then the performance > improvement is arbitrarily high (see the table in > http://info.iet.unipi.it~luigi/polling/ ). 8-). I haven't really had a chance to comment on this; rather than going off on it without a detailed lab study with my own results, let me say that IP forwarding is cheating, since you have another livelock at the interface between user space and system space. The fix only works for the IP forwarding. This is basically the method that Mogul suggests in his 1993 paper. Mohit Aron's group at Rice University also discused using Weighted Fair Share Scheduling. There are a number of good reasons to not like this approach, even given the very smart people it came from, and the idea of fumbling in the scheduler code to decide on interrupts for kernel vs. user space time, really irks me. It makes too many assumptions about how much overhead my processing is going to take, and the distribution of the processing around the mean/median costs. One approach you might try to handle this -- and to know "when to switch", which you noted was "hard" -- would be to add an elements-on-queue counter to the queues involved (this should be an option in any case; my own macros for this are identical to the current queueuing macros, with a "C" on the front of them; counted queues are useful for doing RED-queueing, as well). If the count goes over a certain depth, then you want to disable interrupts entirely, so that the user space application gets a chance to run, and drains out the queue. For the NETISR processing (polling), you would use comparative queue depth to know "when to turn it on". -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message