Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Nov 2006 21:38:21 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Luigi Rizzo <rizzo@icir.org>
Cc:        arch@freebsd.org
Subject:   Re: a proposed callout API 
Message-ID:  <7327.1163453901@critter.freebsd.dk>
In-Reply-To: Your message of "Mon, 13 Nov 2006 13:32:37 PST." <20061113133236.A28926@xorpc.icir.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20061113133236.A28926@xorpc.icir.org>, Luigi Rizzo writes:
>On Mon, Nov 13, 2006 at 08:53:41PM +0000, Poul-Henning Kamp wrote:
>> 

>i am a bit curious on why  you want to split the callouts among
>multiple data structures.

A binary heap is optimal for the timeouts that will happen, but
filling it up with timeouts that are unlikely to, and in most
cases won't happen for a very long time will soak up CPU
time used for pointlessly ordering the heap.

Also, many of the "non-happening" timeouts are repeatedly
rescheduled, the TCP keepalives for instance, having a data structure
where this is free of cost is a big advantage.

The other thing is that covering the entire range from hour long
callouts to nanosecond callouts would require a 64 bit value or
a tricky pseudo-FP encoding.  By splitting them in two classes,
I can use two different 31 bit encodings separated by the top bit.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



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