From owner-freebsd-current@FreeBSD.ORG Sun Jan 30 18:59:58 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 9153816A4CE; Sun, 30 Jan 2005 18:59:58 +0000 (GMT) Received: from cyrus.watson.org (cyrus.watson.org [204.156.12.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6029B43D1D; Sun, 30 Jan 2005 18:59:58 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by cyrus.watson.org (Postfix) with SMTP id B846646B0D; Sun, 30 Jan 2005 13:59:57 -0500 (EST) Date: Sun, 30 Jan 2005 18:59:20 +0000 (GMT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Colin Percival In-Reply-To: <41FD24C2.5070700@freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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:59:58 -0000 On Sun, 30 Jan 2005, Colin Percival wrote: > 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. On some further iteration, it transpired that Poul-Henning's configuration included WITNESS, and without that things look a bit more reasonable. We should still run the callout less often, if we can, and I think the optimization is useful. Robert N M Watson