Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Sep 1997 00:40:34 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, gibbs@plutotech.com
Cc:        current@FreeBSD.ORG, nate@mt.sri.com
Subject:   Re: cvs commit: src/sys/conf files src/sys/dev/vx if_vx.c if_vxreg.h src/sys/i386/apm apm.c src/sys/i386/conf GENERIC files.i386 src/sys/i386/eisa 3c5x9.c aha1742.c aic7770.c bt74x.c eisaconf.c eisaconf.h if_fea.c if_vx_eisa.c src/sys/i386/i386 autoconf.c ...
Message-ID:  <199709221440.AAA18001@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>>requests.  Thats 630 pending callouts and an O(n) hit for insert
>>>and removal...
>>
>>Assuming that the timeout length is not very critical, and that timeouts
>>rarely expire, this setup could be optimized well using "queues"
>>consisting of two (pointers to) arrays of bits, and counters for the
>>number of items set in each array:
>
>Now make it scale during usage.  There are lots of schemes available, 
>but very few are easily scalable by mallocing small chunks of free
>memory.

This one is: when attaching a drive, find a free drive number and malloc
more storage if the new number is at the end.  Rarely free anything.
The main point is that it is easy to build a perfect hash function
(drive_number, transaction_number) -> timeout_slot_number because we
only need one timeout per (drive_number, transaction_number).

Bruce



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