Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jan 2005 18:17:38 +0000
From:      Colin Percival <cperciva@freebsd.org>
To:        Robert Watson <rwatson@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: tcp_isn_tick() / dummynet() callout madness ?
Message-ID:  <41FD24C2.5070700@freebsd.org>
In-Reply-To: <Pine.NEB.3.96L.1050130112410.15336A-100000@fledge.watson.org>
References:  <Pine.NEB.3.96L.1050130112410.15336A-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41FD24C2.5070700>