DragonFly commits List (threaded) for 2007-04
DragonFly BSD
DragonFly commits List (threaded) for 2007-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sys/conf files src/sys/sys alist.h src/sys/kern subr_alist.c


From: Jason Smethers <jason@xxxxxxxxxxxx>
Date: Wed, 18 Apr 2007 18:43:29 -0500

Matthew Dillon wrote:
dillon 2007/04/09 10:10:00 PDT

DragonFly src repository

Modified files:
sys/conf files Added files:
sys/sys alist.h sys/kern subr_alist.c Log:

Allocations of size greater than the radix seem to be returning the wrong starting block. Should the allocator return the starting block at which it allocated from? If so, sys/kern/subr_alist.c at line 393 should be changed to the following (or similar):


		mask = (u_daddr_t)-1 >> (ALIST_BMAP_RADIX - n);
		for (j = 0; j < ALIST_META_RADIX; j += n / 2) {
			if ((scan->bm_bitmap & mask) == mask) {
				scan->bm_bitmap &= ~mask;
				return blk; // <== here
			}
			mask <<= n;
			blk += radix * n / 2; // <== here
		}


Also, there appears to be a redundent check for a terminating block at line 442: the first check is at the start of the for loop on line 412. Removing it shows a 4-5% speed up on allocation from an average of 220ms down to an average of 210ms per allocation for sequential single block allocations on an Athlon X2 2Ghz.



- Jason




[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]