From owner-freebsd-current@FreeBSD.ORG Sun Jan 30 18:17:40 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E248E16A4CE for ; Sun, 30 Jan 2005 18:17:40 +0000 (GMT) Received: from tx6.mail.ox.ac.uk (tx6.mail.ox.ac.uk [163.1.2.171]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CBA943D54 for ; Sun, 30 Jan 2005 18:17:40 +0000 (GMT) (envelope-from cperciva@freebsd.org) Received: from scan6.mail.ox.ac.uk ([163.1.2.179] helo=localhost) by tx6.mail.ox.ac.uk with esmtp (Exim 4.42) id 1CvJdj-0005Pz-Ly for current@freebsd.org; Sun, 30 Jan 2005 18:17:39 +0000 Received: from rx6.mail.ox.ac.uk ([163.1.2.170]) by localhost (scan6.mail.ox.ac.uk [163.1.2.179]) (amavisd-new, port 25) with ESMTP id 20376-09 for ; Sun, 30 Jan 2005 18:17:39 +0000 (GMT) Received: from smtp2.herald.ox.ac.uk ([163.1.0.235]) by rx6.mail.ox.ac.uk with esmtp (Exim 4.42) id 1CvJdi-0005Pc-MQ; Sun, 30 Jan 2005 18:17:38 +0000 Received: from dhcp1151.wadham.ox.ac.uk ([163.1.161.151]) by smtp2.herald.ox.ac.uk with esmtp (Exim 3.35 #1) id 1CvJdi-0002IV-3n; Sun, 30 Jan 2005 18:17:38 +0000 Message-ID: <41FD24C2.5070700@freebsd.org> Date: Sun, 30 Jan 2005 18:17:38 +0000 From: Colin Percival User-Agent: Mozilla Thunderbird 1.0 (X11/20050113) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robert Watson References: In-Reply-To: X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: Poul-Henning Kamp cc: silby@freebsd.org cc: current@freebsd.org Subject: Re: tcp_isn_tick() / dummynet() callout madness ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jan 2005 18:17:41 -0000 Robert Watson wrote: > since the callout_reset() is one of the more > expensive parts of this code, Colin has been looking at some locking > optimizations to lower the cost. To elaborate somewhat: I think I can avoid the spinlock cost when callouts reset themselves (which is the case here). However, while this will reduce the time spent in the callouts themselves, it's really only a 50% solution -- softclock locks and unlocks the callout spin lock each time it launches a callout. If we're spending 5% of our cpu time in these two callouts, then they're actually responsible for using 10% of our cpu time; I think I can cut that in half, but in the end we can't avoid the cost of a mtx_lock_spin / mtx_unlock_spin pair (in softclock) for each callout. Colin Percival