svn commit: r243631 - in head/sys: kern sys

Alexander Motin mav at FreeBSD.org
Mon Jan 14 16:23:12 UTC 2013


On 14.01.2013 18:05, Andre Oppermann wrote:
> On 14.01.2013 16:51, Alexander Motin wrote:
>> As I've actually written, there are two different things:
>>   ncallout -- number of preallocated callout structures for purposes of
>> timeout() calls. That is a legacy API that is probably not very much
>> used now, so that value don't need to be too big. But that allocation is
>> static and if it will ever be exhausted system will panic. That is why
>> it was set quite high. The right way now would be to analyze where that
>> API is still used and estimate the really required number.
> 
> Can timeout() be emulated on top of another API so we can do away with it?

It is already emulated on top of callout_init()/callout_reset(). The
problem is that callout_init()/callout_reset() assume storage memory to
be allocated by consumer, while timeout() assumes it to be allocated by
subsystem. The only way to solve it is to rewrite remaining timeout()
consumers to use callout_init()/callout_reset() API directly.

>>   callwheelsize -- number of slots in the callwheel. That is purely
>> optimizational value. If set too low, it will just increase number of
>> hash collisions without effects other then some slowdown. Optimal value
>> here does depend on number of callouts in system, but not only. Since
>> array index there is not really a hash, it is practically useless to set
>> array size it higher then median callout interval divided by hz (or by
>> 1ms in calloutng). The problem is to estimate that median value, that
>> completely depends on workload.
> 
> OK.  So for example a large number of TCP connection would use up a
> large number of slots in the callwheel.  I'll try to come up with a
> reasonable sane scaling value.

Yes, it _may_ use, but that also depends on time intervals. If most of
these TCP timeouts will be few seconds long for ACK timeout, there will
be no any performance difference between having callwheelsize of 100*hz
and 10000*hz. Same time, if periods are measured in hours, like for
keep-alives, increasing callwheelsize may be effective.

>> Each one ncallout cost 32-52 bytes, while one callwheelsize only 8-16
>> and could probably be reduced to 4-8 by replacing TAILQ with LIST. So
>> that is ncallout and respective timeout() API what should be managed in
>> first order.
> 
> I'll give it a try.

Thanks.

-- 
Alexander Motin


More information about the svn-src-all mailing list